WordPress.org

Support

Support » Plugins and Hacks » [Plugin: NextGEN Gallery] Back-to-Album Button…is there such a thing in new version?

[Plugin: NextGEN Gallery] Back-to-Album Button…is there such a thing in new version?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’d love to know as well…

    Boris

    @travel-junkie

    This is what I have on my gallery pages. Open up page.php and look for this:
    <?php the_content(); ?>

    Just above it paste following code (after you filled in the ID and the URL):

    <?php global $post;
    if ($post->post_parent == ENTER HERE THE ID OF THE OVERVIEW PAGE){ ?>
    <p>
    <a href="ENTER THE URL OF THE OVERVIEW PAGE"><?php _e('<< Back to gallery overview') ?></a>
    </p>
    <?php } ?>

    This code depends on every gallery page being a child page of the gallery overview page.

    Boris

    @travel-junkie

    Of course, now that we have templates you can add something similar to gallery.php in the nggallery folder you copied into your theme folder. This would make more sense.

    Can anyone confirm that this still works? I can’t seem to get it right and it won’t display the link. However, if I manually go to “edit page” and set the parent ID of the album page to a random page with a known ID, the back link will be displayed (but on both the album and gallery pages).

    I’m sure that I have the correct ID of the gallery page (I checked for it using themouseover technique). I’m running WP 2.7 with permalinks enabled and NextGEN 1.2.1.

    Thanks for this, came in very useful, and I learned some new php today! 🙂

    (…and for Xspringe, using WP 2.8, latest NextGEN from October 2009 with no problems.)

    The link is not showing up for me. Can anyone see the problem? Thanks

    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post-page" id="post-<?php the_ID(); ?>">
    		<h2 class="page_title"><?php the_title(); ?></h2>
    			<div class="entry entry_page">
    
    <?php global $post;
    if ($post->post_parent == 53){ ?>
    <p>
    <a href="http://holidays.letang.info/?page_id=53"><?php _e('<< Back to gallery overview') ?></a>
    </p>
    <?php } ?>
    
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    				<?php edit_post_link('Edit this entry.', '<br /><p>', '</p>'); ?>
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    	</div>
    
    <?php get_footer(); ?>

    the second line is missing the ” around the 53. Correct is:

    if ($post->post_parent == '53'){ ?>

    Another important detail is that you need to have your galleries on their own (sub)pages.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: NextGEN Gallery] Back-to-Album Button…is there such a thing in new version?’ is closed to new replies.
Skip to toolbar