• Resolved chaplaindoug

    (@chaplaindoug)


    I would like to add a graphic (logo) to left of the Twenty Twelve site title and tag line. How can I do that? It would be nice to do that for all pages and sites (I am using MultiSite). Any help appreciated. Thanks.

Viewing 6 replies - 16 through 21 (of 21 total)
  • Never mind, I see it’s my error in css.

    Cleared the slate and started again. Still luck moving that darn foot to the left.

    Thanks for your help wp-21 and I think, though I’m not certain, that I should also thank you for letting me struggle through this.

    I was able to insert my logo image in the header, to the left of the title and tagline, by doing the following inside the header.php in my child theme:

    <hgroup>
    			<h1 class="header-image"><span><?php $header_image = get_header_image();
    		if ( ! empty( $header_image ) ) : ?>
    			<a>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="MY WEBSITE" /></a>
    		<?php endif; ?></span>
    			<h1 class="site-title"><a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    			<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
    		</hgroup>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum’s parser.]

    Then adding the following as the last command under /*header*/ in the css.styles sheet (child theme):

    .header-image {
    width: auto;
    float: left;
    margin: auto 20px 10px auto;
    }
    .site-header h1,
    .site-header h2 {
    clear: none;
    }

    It’s interesting how there’s, apparently, no ‘one way’ how to do all this. Thanks.

    This is a CSS-only method to add a clickable logo to the left of title/tagline.

    /* ===== begin logo ===== */
    
    .site-header h1 a:before {
    	content: "";
    	display: block; width: 48px; height: 48px;
    	margin: 0 auto 12px;
    	background-image: url("https://dummyimage.com/72x72/ff0000/ffffff.png");
    	background-size: cover;
    }
    .site-header h1 { margin-bottom: 0; }
    
    @media screen and (min-width: 600px) {
    	.site-header h1 a:before {
    		width: 72px; height: 72px;
    		position: absolute; top: 0; left: -96px;
    	}
    	.site-title, .site-description { position: relative; margin-left: 96px; }
    }
    
    /* ===== end logo ===== */

    @paulwpxp — Now that’s beautiful! That’s the answer I was hoping for! Thanks a million!

    @mkeller4: If you require assistance then, as per the Forum Welcome, please post your own topic.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Adding Logo to Left of Site Title and Tagline: Twenty Twelve’ is closed to new replies.