views:

89

answers:

2

I'm trying to put an image (logo.png which is in the very same folder as index.php) in index.php (line 23):

<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Starkers
 * @since Starkers 3.0
 */
//$body ="home";
get_header();
//include_once 'localization.php';
?>
<div id="content">
    <div class="container">
        <div id="header-bottom">
            <div id="slider">
                <img src="logo.png"/>
            </div>
            <div id="tagline">
                <p>This a testThis a testThis a testThis a testThis a testThis a test</p>
                <p>This a testThis a testThis a testThis a testThis a testThis a test</p>
            </div>
        </div><!-- header-bottom -->
        <div id="mainbar">
            <?php
            /* Run the loop to output the posts.
             * If you want to overload this in a child theme then include a file
             * called loop-index.php and that will be used instead.
             */
             get_template_part( 'loop', 'index' );
            ?>
            <p><?php echo $test; ?></p>
        </div>
        <?php get_sidebar(); ?>
    </div><!-- .container -->
</div><!-- #main-content -->
<?php get_footer(); ?>

it doesn't matter if I put logo.png in the same folder as index.php the image doesn't appear

Webkit development tools says:

Resource interpreted as image but transferred with MIME type text/html.

Don't know what it means

Any suggestions?

+1  A: 

What happens when you try:

<img src="http://www.site.com/logo.png"/&gt;
rrrfusco
Weird, it worked: <img src="http://localhost/wordpress/wp-content/themes/starkers/logo.png"/>Why is this happening?
janoChen
A: 

This made it work:

<img src="<?php bloginfo('template_directory'); ?>/images/featured.png"/>

I didn't know I had to include the template_directory.

janoChen