Showin gallery prev/next links IF necessary
-
Hi,
What I need is for the ability to show or hide a <div> containing my next/prev controls for image galleries depending on whether or not there’re actually any other images. At the moment I have this:
<?php if ( previous_image_link() != null || next_image_link() != null ) { ?> <div class="page_controls"> <div class="wp-caption alignleft"> <?php previous_image_link() ?> </div> <div class="wp-caption alignright"> <?php next_image_link() ?> </div> </div> <?php } ?>
But this isn’t working. It echoes out the prev/next links as usual, but not all the <div>s in my if statement.
I’m fairly sure my if statement is invalid, but I don’t know what to do to make this concept work. Hopefully my code is enough to demonstrate exactly what I’m after, though.
I really hope someone can help me out as I’ve torn my hair out for an hour trying to do this myself. :~
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Showin gallery prev/next links IF necessary’ is closed to new replies.