Excluding a gallery title from navigation
-
I’m using the JP photo theme which allows you show your photo via galleries.
The process is you create a gallery, add photos and that gallery name is added to the nav bar for navigation.
I would like to create gallery but exclude is from the navigation list.
I believe this is the part of code that deals with it
<div class=”galleries”>
<ul class=”gallery_list”>
<?php foreach ($galleries as $k=>$gallery): ?>
<?php if ($k > 0 && $k % 3 == 0): ?><ul class=”gallery_list”>
<?php endif; ?>
<li class=”gallery_list_item”>ID == $gallery_id)?’active’:”; ?>” href=”<?php echo get_permalink($gallery->ID); ?>”><?php echo $gallery->post_title; ?>
<?php endforeach; ?></div>
If I find out the gallery ID using reveal plugin, how can I exclude that ID (gallery from the navigation?
all help welcome
My site is http://www.paulcliftonphotography.commany thanks
Paul
-
Something like this should work right below the
foreach()line:
<?php if ( $gallery->ID == $skip_this_ID ) continue; ?>So I added the snipet in:
<div class=”galleries”>
<ul class=”gallery_list”>
<?php foreach ($galleries as $k=>$gallery): ?>
<?php if ( $gallery->ID == $skip_this_68 ) continue; ?>
<?php if ($k > 0 && $k % 3 == 0): ?><ul class=”gallery_list”>
<?php endif; ?>
<li class=”gallery_list_item”>ID == $gallery_id)?’active’:”; ?>” href=”<?php echo get_permalink($gallery->ID); ?>”><?php echo $gallery->post_title; ?>
<?php endforeach; ?></div>
added the ID that the reveal plugin gave me but sadly nothing changed.
Did I add it correctly?Paul
Sort of but not quite. If 68 is the ID, try this variant:
<?php if ( $gallery->ID == 68 ) continue; ?>If this doesn’t work either, please post your latest code again, this time enclosed by backticks. Without them, the forum’s parser does weird things to your code such that it’s incomplete and possibly missing an important detail.
Score!!!
Cheers for your help, that’s fixed it.
Paul
The topic ‘Excluding a gallery title from navigation’ is closed to new replies.