Forum

Please make sure that you have read the documentation and extensive resources provided on this site before posting your question!

Dynamic Content Gallery Resources

DCG Version 4.0 beta is now available for download and testing. This is a development version and not recommended for live sites. Read more here.

Note that the current stable release of the DCG is version 3.3.5.

 
You must be logged in to post Login Register


Register? | Lost Your Password?

Search Forums:


 






Minimum search word length is 3 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Code placement issue – gallery not showing on index.php

open
UserPost

11:12 pm
June 16, 2010


maasd

Guest

1

Post edited 11:13 pm – June 16, 2010 by maasd


Wordpress 2.9.2, theme "Prosumer" http://www.welcomewitnessandwonder.ca

Plugins:

-Dynamic Content Gallery

-Exclude Pages from Navigation

-JR Favicon

-Simple Image Widget

 

DCG Settings

Your active key Settings: 

Image File Management: full URL

Gallery Method: one-category | Default Images folder is: http://www.welcomewitnessandwonder.ca/wp-content/uploads/2010/06/

Slide Pane Description: auto

Page Source Error messages: on | Javascript Framework used: mootools

Scripts restricted to: Page ID => 4 (set to home page which is index.php)

 

I've tried everything I can think of…

- I've posted the code everywhere imagineable in the index.php page using Appearance->Editor and pasting the code in index.php.  Nothing shows up.  Here's the code on index.php as it currently is:

 

<?php get_header(); ?>
<div id="content">
<?php dynamic_content_gallery(); ?>
  <?php if (have_posts()) : ?>
  <?php while (have_posts()) : the_post(); ?>
  <div class="post" id="post-<?php the_ID(); ?>">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<p class="meta">
 <span class="timr"><?php the_time('F d, Y') ?></span>
 <span class="user">By: <?php the_author() ?> </span>  
 <span class="catr">Category: <?php the_category(', ') ?></span>
 <?php edit_post_link('Edit', '<span class="editr">', '</span>'); ?>
 </p>
    <div class="entry">
      <?php the_content('Read the rest of this entry &rarr;'); ?>
    </div>
  <?php if(function_exists('the_tags')): ?>
  <div class="tags"><?php the_tags('Tags: ', ', ', ''); ?></div>
  <?php endif; ?>
    
<p class="postmeta">
      <span class="commr"><?php comments_popup_link('No Comments &rarr;', 'Comment (1)', 'Comments (%)'); ?></span>
 </p>
</div>
  <?php endwhile; ?>
  <div class="navigation">
    <div class="alignleft">
      <?php next_posts_link('&larr; Previous Entries') ?>
    </div>
    <div class="alignright">
      <?php previous_posts_link('Next Entries &rarr;') ?>
    </div>
  </div>
  <?php else : ?>
  <h2 class="center">Not Found</h2>
  <p class="center">Sorry, but you are looking for something that isn't here.</p>
  <?php include (TEMPLATEPATH . "/searchform.php"); ?>
  <?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

<?php get_header(); ?>

<div id="content"><?php dynamic_content_gallery(); ?>  <?php if (have_posts()) : ?>  <?php while (have_posts()) : the_post(); ?>  <div class="post" id="post-<?php the_ID(); ?>">

    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> <p class="meta">  <span class="timr"><?php the_time('F d, Y') ?></span>  <span class="user">By: <?php the_author() ?> </span>    <span class="catr">Category: <?php the_category(', ') ?></span>  <?php edit_post_link('Edit', '<span class="editr">', '</span>'); ?>  </p>    <div class="entry">      <?php the_content('Read the rest of this entry &rarr;'); ?>    </div>

  <?php if(function_exists('the_tags')): ?>  <div class="tags"><?php the_tags('Tags: ', ', ', ''); ?></div>  <?php endif; ?>    <p class="postmeta">      <span class="commr"><?php comments_popup_link('No Comments &rarr;', 'Comment (1)', 'Comments (%)'); ?></span>  </p> </div>  <?php endwhile; ?>  <div class="navigation">    <div class="alignleft">      <?php next_posts_link('&larr; Previous Entries') ?>    </div>    <div class="alignright">      <?php previous_posts_link('Next Entries &rarr;') ?>    </div>  </div>  <?php else : ?>  <h2 class="center">Not Found</h2>  <p class="center">Sorry, but you are looking for something that isn't here.</p>  <?php include (TEMPLATEPATH . "/searchform.php"); ?>  <?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

- When I paste the code in the "page.php" Page Template file, the gallery shows up on the home page perfectly however weird things happen on all other "pages" (not post pages, just "page" pages).  The image and description from each of the gallery items appears on EVERY PAGE!  Using the Mootools setting it appears TWICE on every page, and using the Jquery setting it appears once on every page.  Here are screenshots of what happens when the code is placed on teh 'page.php' page:

So far so good – gallery loads fine. Clicking on each news item goes to the appropriate news posting as well – no problem.

 

The problems come on all other separate created pages.

On every page is each picture twice plus just the abbreviated text that was in the gallery description text.

 

I suspect in the end that I should not have the code in the page.php file, but for the life of me I can't figure out why it's not appearing on the home page when I add the code to index.php!  Any ideas? Thanks!

 

3:53 pm
June 20, 2010


Ade

Admin

posts 2384

2

Hi,

Page.php is the correct location. However, since you're using Genesis, you should handle this in a conditional check in functions.php. Basically, you need to create a custom function, something like this:

function load_dcg() {
if( is_page('4') {
dynamic_content_gallery();
}
}
You then need to hook this function to the appropriate Genesis hook. I don't handle Genesis support questions here – please post your question on the Studiopress forum. Thanks.

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?