• Hi,

    I know there are a million posts on this topic, but after reading through a ton of them, I can’t seem to figure out my problem. I created a child theme of twenty eleven and I’m trying to add a square logo to the left of the Site Title and Site Description. The positioning isn’t quite right yet, but I know that I need to play with the css to fix that.

    Right now, my biggest concern is that the logo image is not showing up and I’m just getting a blue question mark. I put the logo image (called site-logo.png) in a folder called “images” in my child theme folder. I edited the header.php of my child theme after doing a lot of research so that it reads:

    <h1 id="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img id="site-logo" src="<?php echo bloginfo('url'); ?>/images/site-logo.png" alt="" /></a><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>

    Now the question mark is there, but the image isn’t showing up. I’m not sure if I have the logo saved in the wrong place, or I messed up the php somehow or what. I’m very new to this so I’m sorry if this is a very obvious thing to solve.

    My website is https://www.blog.maddielabstudio.com.

    Thanks for any help you might be able to give me.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Try using <?php get_stylesheet_directory_uri(); ?>/images/site-logo.png instead of <?php echo bloginfo(‘url’); ?>/images/site-logo.png

    Thread Starter maddielab

    (@maddielab)

    I just tried that, but it didn’t work. The path to where my image is saved is “/wp-content/themes/twentyeleven-child/images” and the header.php file is in “/wp-content/themes/twentyeleven-child/”. Is that the correct thing to do? Could I have possibly messed up where I saved it?

    What I said should have worked with how you are describing it. I saw that the image path was incorrect when I first looked at it. Change it back to <?php get_stylesheet_directory_uri(); ?>/images/site-logo.png and reply back so we can see what path it is showing.

    Thread Starter maddielab

    (@maddielab)

    OK, I put that in and it still doesn’t seem to be working. I’m at a bit of a loss because, from what I read, I figured it should work too. I have no idea what I’m doing wrong.

    Post the code that you are using for that to display like that.

    Thread Starter maddielab

    (@maddielab)

    How much of it do you want me to post? Here’s the part that I’m pretty sure is relevant.

    <body <?php body_class(); ?>>
    <div id="page" class="hfeed">
    	<header id="branding" role="banner">
    			<hgroup>
    				<h1 id="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img id="site-logo" src="<?php get_stylesheet_directory_uri(); ?>/images/site-logo.png" alt="" /></a><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
    				<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
    			</hgroup>

    You have SuperCache enabled on your site – have you cleared that?

    Thread Starter maddielab

    (@maddielab)

    In my controls it said that the only plug-in that was activated was jetpack. I just deleted WP SuperCache anyway just in case, but it doesn’t seem to have made a difference.

    Try this:

    src="<?php echo get_stylesheet_directory_uri(); ?>/images/site-logo.png"

    Thread Starter maddielab

    (@maddielab)

    It worked! Thank you so much for all of your help! Now to just play with the css to get it where I want it…

    Again, thanks so much!

    No problem.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Logo Image Won't Show Up’ is closed to new replies.