Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress genesis theme - changing the logo from text to graphic

Tags:

wordpress

I'm using the vanilla Geneis theme with no child, but I cannot find where the logo should reside. I can change the favicon no worries, but I see no logo file present and I see no advice on how to add to the "parent" theme - I'm not using a child.

Is there a way to add a logo. I have changed the settings in wordpress for a logo rather than text (in the header settings). Any ideas?

like image 693
Androidian Avatar asked Jun 26 '12 11:06

Androidian


People also ask

How do I add a logo to my Genesis theme?

Change the Header Settings for your ThemeGo to Genesis-> Theme Settings in your dashboard. Locate the option for Header and change the option 'Use for site title/logo' to 'Image Logo'. Remember to Save the Settings upon making any changes. The Save button is present at the bottom of the Theme Settings Page.

How do I change the header logo in WordPress?

Log in to your WordPress dashboard. Select “Customize” from the drop down menu under “Appearance”. Once you've found the area that controls your header, click “Select Image”. Click “Select Files” to upload the image file you want to use as your header logo.


2 Answers

Although I haven't done this on the default Genesis theme, I have replaced the main headline text with just a logo. I posted how I did it on the Genesis Forum, but here it is.

If you want to keep the rest of the genesis_do_header hook in place, you can just replace the default genesis_do_header using the child theme's functions.php.

Open up functions.php and add the following:

// Replace header hook to include logo 
remove_action( 'genesis_header', 'genesis_do_header' ); 
add_action( 'genesis_header', 'genesis_do_new_header' ); 
function genesis_do_new_header() { 
    echo '<div id="title-area"><img src="your/logo/image.jpg" alt="Site Logo" />'; 
    do_action( 'genesis_site_title' ); 
    do_action( 'genesis_site_description' ); 
    echo '</div><!-- end #title-area -->'; 
    if ( is_active_sidebar( 'header-right' ) || has_action( 'genesis_header_right' ) ) { 
        echo '<div class="widget-area">'; 
        do_action( 'genesis_header_right' ); 
        dynamic_sidebar( 'header-right' ); 
        echo '</div><!-- end .widget-area -->'; 
    } 
}  

You can then style the image with your CSS in the following fashion:

#title-area img {
    float:left;
}

You should now see your logo floated to the left of your site title. You may have to tweak some things, as the themes aren't identical, but let me know how this works for you.

like image 65
Ryan Avatar answered Nov 15 '22 12:11

Ryan


Not to resurrect an old post or anything but I found a solution that works better than the one proposed above:

If you want to remove Title and Description then add following code in functions.php. This is useful when you decide to use site logo instead of text for site title.

/** Remove Title & Description **/
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
/** Remove default site title and add custom site title **/
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
function custom_site_title() { 
     echo '<a href="'.get_bloginfo('url').'" title="My Website"><img src="'.wp_get_attachment_url(254).'" alt="My Website"/></a>';
}
add_action( 'genesis_site_title', 'custom_site_title' );
like image 44
Devin Walker Avatar answered Nov 15 '22 12:11

Devin Walker