posts_nav_link images
-
WordPress recommends that for links inside of posts_nav_link, you can use the example below found on this page.
<?php posts_nav_link(' ', '<img src="images/prev.jpg" />', '<img src="images/next.jpg" />'); ?>
So I’ve written my code like the following:
<ul> <li id="previous"><?php posts_nav_link('',' ','<img src="images/prevbttn.png" />') ?> <li id="next"><?php posts_nav_link('','<img src="images/nextbttn.png" />',' ') ?> </ul>
Do I need to use ul and li? Not necessarily, but it’s what I have at the moment, and can be easily changed later if I feel like it. Back on track, this doesn’t work. My images don’t show up – the browser recognizes an image is supposed to be there, but can’t find it.
The big problem I’ve had with every image link I’ve propagated in PHP is that I need to use this format:
<?php bloginfo('template_directory') ?>/images/image.extension
But if I were to use that format in the above code in this case, the page breaks.
<ul> <li id="previous"><?php posts_nav_link('',' ','<img src="<?php bloginfo('template_directory') ?>/images/prevbttn.png" />') ?> <li id="next"><?php posts_nav_link('','<img src="<?php bloginfo('template_directory') ?>/images/nextbttn.png" />',' ') ?> </ul>
What can I do to still display the images I want to use?
- The topic ‘posts_nav_link images’ is closed to new replies.