Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14318 reviews 1707 hosting providers

Questions & Answers

Wordpress HTML Image tag problem

Nov 15, 2012 by SunFun
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?

2 Answers

0 votes
Nov 16, 2012 by TopNet
You can’t use PHP in WordPress editors. You should be using hard coded URLs.
0 votes
Nov 16, 2012 by expert
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.