crazyfish Posted October 27, 2008 Share Posted October 27, 2008 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="'.bloginfo('template_directory').'/images/left.png" />','<img src="'.bloginfo('template_directory').'/images/right.png" />'); ?> but this is what it outputs which is all messed up. 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> it should be <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> Quote Link to comment https://forums.phpfreaks.com/topic/130322-trying-to-get-php-code-to-work-in-wordpress/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.