tags:

views:

239

answers:

3

Hello,

In the code below, I am using an image (images/newlogo.PNG) for a logo. I am trying to add the same logo to a Wordpress blog, but Wordpress can't seem to find the logo. Any idea where I should put the image so that Wordpress can find it?

Thanks in advance,

John

<div class="newlogo">
    <a href="index.php">
        <img src="images/newlogo.PNG" alt="Books" border="0"/>
    </a>
</div>
A: 

If you use an 'absolute' path (relative to the server) like this:

<img src="/images/newlogo.PNG" alt="Books" border="0"/>

You just need to put the image in the images folder in the root of the server

victor hugo
That's the thing-- they are in the images folder, and it works fine for my site. But for the Wordpress blog, it doesn't.
John, the path in your example is not an absolute path - it's missing the leading slash.
Meredith L. Patterson
A: 

I think you need to have the file in the wp-content folder.

ShaunLMason
+2  A: 

My experiece with WordPress is many times you need the full path for images called outside of the style sheet, because your full path is something like username/public_html/wordpresshere

Best to put images in your theme so they stay put whn you change themes or go along when you download/backup themes

So, hardcode your full path from your URL, or:

Use this to return site URL:

<?php bloginfo('url'); ?>/wp-content/themes/default/images/newlogo.png


Or this to return the current template directory:

<?php bloginfo('template_directory'); ?>/images/newlogo.png



Like this:

<img src="<?php bloginfo('template_directory'); ?>/images/newlogo.PNG" alt="Books" border="0"/>
songdogtech
Yup, this is the answer. You need that line of php to tell wordpress what the actual page is: <?php bloginfo('template_directory'); ?>
Joey Baker
Yes, 'template_directory' throws the path for the current theme. But in the CSS of each theme's style sheet - no matter the current or others that are not activated - you can use the path images/newlogo.png, because the images are one directory down from the style sheet, i.e.`body{background: url(images/newlogo.png) repeat;font-size: small;font-family:Verdana, Tahoma, Arial, Serif;color: #000;font-size:0.7em;}`
songdogtech