Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to customize twentyten theme.
this is part of header.php:

<body <?php body_class(); ?>>
<div id="wrapper" class="hfeed">
    <div id="header">

<img id="topL" src="images/img01.png"/> //this img I cannot insert  !   

</div><!-- #header -->

No errors. Simply - nothing happens.

share|improve this question

closed as too localized by Wyck, Michael, toscho Jan 4 '13 at 22:28

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Is there a public URL? –  s_ha_dum Jan 4 '13 at 21:44
    
@s_ha_dum, no, it's on my localhost :( –  bonaca Jan 4 '13 at 21:50
    
@toscho, Firebug shows all divs normally, including header div which is the parent div of the image, but there is no image inside, and there is no error. –  bonaca Jan 4 '13 at 21:55
    
Look at the real source, not at the rendered JS DOM. –  toscho Jan 4 '13 at 21:56
    
@toscho, important, Firebug shows my starting code version - i. e. <img id="topL" src="/images/img01.png"> –  bonaca Jan 4 '13 at 21:57

1 Answer 1

up vote 1 down vote accepted

Don't use a relative URL. If you look at the source you are probably trying to load the image from http://sitename.com/images/ when what you likely want is http://sitename.com/wp-content/themes/themename/images/. Assuming the image is in the theme directory in a folder that shares a directory with style.css, do this:

<img id="topL" src="<?php echo get_stylesheet_directory_uri(); ?>/images/img01.png"/> 

http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri

share|improve this answer
    
s_ha_dum, the image is in the theme directory in a folder that shares a directory with style.css, yes it is, and I placed your code - and again - nothing ! –  bonaca Jan 4 '13 at 21:42
1  
I believe that should be echo get_stylesheet_directory_uri(); –  bungeshea_ Jan 4 '13 at 23:42
    
You are correct, @bungeshea. –  s_ha_dum Jan 4 '13 at 23:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.