Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've tried: what could cause get_stylesheet_directory_uri() to fail?
But din't try the function there. Unfortunately, it won't work for me.
Developing a WordPress theme. WordPress version is 3.4.2.

Here is the HTML:

<header>
    <div id="branding">
            <div id="top_ad_left"><a href="#"><img src="<?php echo get_stylesheet_directory_uri() ?>/images/ad-top-left.jpg" alt="top-right-ad" title="top-right-ad" width="260" height="90" /></a></div>
            <a href="<?php echo home_url(); ?>/" title="<?php bloginfo( 'name' ) ?>" rel="home">
                <div id="logo"></div>
            </a>
            <div id="top_ad_right"><a href="#"><img src="<?php echo get_stylesheet_directory_uri() ?>/images/ad-top-right.jpg" alt="top-right-ad" title="top-right-ad" width="260" height="90" /></a></div>

            <div id="blog-title"><span><a href="<?php echo home_url(); ?>/" title="<?php bloginfo( 'name' ) ?>" rel="home"><?php bloginfo( 'name' ) ?></a></span></div>
            <?php if ( is_home() || is_front_page() ) { ?>
                <h1 id="blog-description"><?php bloginfo( 'description' ) ?></h1>
            <?php } else { ?>
                <div id="blog-description"><?php bloginfo( 'description' ) ?></div>
            <?php } ?>
        </div><!-- #branding -->

        <div id="access" align="center">
            <div class="skip-link"><a href="#content" title="<?php _e( 'Skip to content', 'your-theme' ) ?>"><?php _e( 'Skip to content', 'your-theme' ) ?></a></div>
            <?php wp_nav_menu( array( 'theme location' => 'primary', 'fallback_cb' => ''  ) ); ?> <!-- enabling custom menus -->
        </div><!-- #access -->

</header>

And here is the CSS:

#branding {
    //margin: 0 0 1.5em 0;
    height: 140px;
}

#top_ad_left{
    float:left;
    position:relative;
    max-width:300px;
    max-height:100px;
    width: 260px;
    height: 90px;
    z-index:9999;
    }

#logo{
    background-image: url('images/logo.png');
    background-repeat: no-repeat;   
    width: 340px;
    height: 60px;
    float:left;
    position:relative;
    margin:0;
    }

#top_ad_right{
    float:right;
    position:relative;
    max-width:300px;
    max-height:100px;
    width: 260px;
    height: 90px;
    z-index:9999;
    }

#blog-title,
#blog-description{
    display:none; /* as they are not needed for the layout */
    }


/* WP MENU
---------------------------------------------------------------*/

.skip-link {
    display: none;
}

Everything is good and fine. The logo is showing perfectly. But the other two images are not displaying. What's the problem? I want something like this image: Here is what I want it to be

With firebug I saw some discoloration in the desired div's anchor (<a></a>). As we can see in blog-title, because they are display:none;
Is there a problem regarding this? The <?php echo get_stylesheet_directory_uri() ?> code is working fine as they are loading images as you can see in firebug image. Firebug of the project

The <img> tag's CSS are:

        margin: 0;
        padding: 0;
        border: 0;
        outline: 0;
        vertical-align: baseline;
        background: transparent;
share|improve this question
1  
By the looks of it, the images are loading fine (i.e. the src is correct & get_stylesheet_directory_uri() is working) - if so, this is strictly a CSS question & belongs on SO! – TheDeadMedic Nov 5 '12 at 10:27
3  
Disable your adblocker. – toscho Nov 5 '12 at 10:34
Thanks @toscho, that's the problem. hah? I installed adBlocker in Firefox. Now disabled, and it's fine. Thanks a lot for figuring this out. :) – Mayeenul Islam Nov 5 '12 at 11:05
1  
You could also change your CSS selectors from *_ad_* to something else. Removing "ad" so it doesn't trigger your ad-blocker. – userabuser Nov 5 '12 at 11:28

closed as too localized by toscho Nov 5 '12 at 11:22

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, see the FAQ.

Browse other questions tagged or ask your own question.