Wordpress HTML Image tag problem

87 views
asked Nov 15, 2012 in Website Builder by SunFun (3,000 points)
Hi..
I tried inserting an HTML image tag to my index.php  file using this code
<img src="<?php bloginfo( 'template_directory' ); ?>/images/perimg/P1.jpg">
It shows up right but when I try to edit a page from the dashboard and paste the exact code in my HTML editor then the image fails to show.
Does anyone know what’s causing this?
thanks

2 Answers

0 like 0 dislike
answered Nov 16, 2012 by TopNet (10,360 points)
You can’t use PHP in WordPress editors. You should be using hard coded URLs.
0 like 0 dislike
answered Nov 16, 2012 by expert (14,380 points)
If you want to upload images, simply use the Media Uploader above in your dashboard above the HTML Editor. Or you can use a plugin that does the same thing.
...