I'm trying to use images for the next page and prev page links but I'm not very good with PHP so I think I am messing something up. If I put the relative path to the template the images work but if I try to call the images based on the template folder it fails. I'm trying to get the below code to work: <?php posts_nav_link(' ','<img src="<?php bloginfo('template_directory'); ?>/images/left.png" />','<img src="<?php bloginfo('template_directory'); ?>/images/right.png" />'); ?> Code (markup): I'm pretty sure it's just my syntax that's wrong I get a parsing error.
<?php posts_nav_link(' ','<img src="<?php bloginfo('template_directory'); ?>/images/left.png" />','<img src="<?php bloginfo('template_directory'); ?>/images/right.png" />'); ?> you start a php code segment with <?php then in the function call you state src="<?php and there you start another code segment but you are already in the code segment '<img src="'.bloginfo('template_directory').'/images/left.png" />' should work?
Hi Thanks for the suggestion, this is what I tried: <?php posts_nav_link(' ','<img src="'.bloginfo('template_directory').'/images/left.png" />','<img src="'.bloginfo('template_directory').'/images/right.png" />'); ?> Code (markup): This is the html it outputs, which doesn't work. http://mydomain.com/testwp/wp-content/themes/black bloghttp://mydomain.com/testwp/wp-content/themes/black blog<a href="http://mydomain.com/testwp/?paged=2"><img src="/images/right.png" /></a> Code (markup): That's the right path but it's placing the URL outside of the a and img tags. Did I not add your suggestion properly?
More code like what? I posted the exact PHP code I'm trying to use and what it output which if it was formatted correctly would display properly but the html is all messed up. What else would help?
This is the output with the above PHP code http://mydomain.com/testwp/wp-content/themes/black bloghttp://mydomain.com/testwp/wp-content/themes/black blog<a href="http://mydomain.com/testwp/"><img src="/images/left.png" /></a><a href="http://mydomain.com/testwp/?paged=3"><img src="/images/right.png" /></a> Code (markup): The html for each image should come out like this: <a href="http://mydomain.com/testwp/"><img src="http://mydomain.com/testwp/wp-content/themes/black blog/images/left.png" /></a><a href="http://mydomain.com/testwp/?paged=3"><img src="http://mydomain.com/testwp/wp-content/themes/black blog/images/right.png" /></a> Code (markup): As you can see it is placing the path to the template file outside of the html tags.