Use php in image links
-
Hey everyone!
I’m relatively new to PHP and WordPress so bear with me. I’m trying to build my WordPress site locally before putting live online. I’m putting images into a page but I don’t want to use the link “http://localhost:8888/wp-content/uploads/%5Bimage name here].jpg” every time I post a link.
Is there a way I can use PHP in the img tag?
Something like this
<a href="http://twitter.com/igerard><img src="<?php echo bloginfo('url'); ?> /wp-content/uploads/[image name here].jpg"></a>Sorry if this is a stupid question.
Thanks!
The topic ‘Use php in image links’ is closed to new replies.