Help Adding a Widget Area to Genesis Magazine Child Theme Header

Community Forums Forums Design Tips and Tricks Help Adding a Widget Area to Genesis Magazine Child Theme Header

This topic is: not resolved

This topic contains 5 replies, has 3 voices, and was last updated by  perplexed 1 year, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #20880

    perplexed
    Participant
    Post count: 3

    Good Afternoon,

    I’m attempting to customize the Genesis Magazine Child Theme. Having never worked with the Genesis framework before, I’m finding this quite challenging. The test site is located here:
    http://greenhousegraphix.com/crunchy/

    What I’m trying to do is add a widget to the top left corner to house the logo. I’m using a widget because there will be 4 logos, one for each season, and I thought this would be an easy way for the user to change them.

    Here’s what I’ve done.
    1. duplicated lib/structure/header.php from the genesis folder and placed into the magazine folder. (I assumed I had to keep this same structure)
    2. I changed line 847-851 to:
    function genesis_do_header() {

    echo '<div id="title-area">';
    dynamic_sidebar( 'logo' );
    echo '</div><!-- end #title-area -->';

    3. I added to functions.php:
    genesis_register_sidebar( array(
    'id' => 'logo',
    'name' => __( 'logo', 'magazine' ),
    'description' => __( 'This is the logo.', 'magazine' ),
    ) );

    I’m sure I’ve done something wrong, any insight would be appreciated.
    Thanks.

    #20903

    cehwitham
    Participant
    Post count: 396

    Hi,

    I think you’re over complicating this a bit. There’s actually no need to duplicate the header.php file and location (although this is common when editing some other child themes that aren’t based on Genesis).

    I suggest you start by reading up on hooks here: http://my.studiopress.com/docs/hooks/
    What you essentially need to do is (this can all be done in functions.php in your child theme)

    Remove the title and tagline:

    remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
    remove_action( 'genesis_site_description', 'genesis_seo_site_description' );

    Then write a function to output your widget area (note you will need to register your widget area too):

    function output_my_logo(){

    if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'logo' ) ) {
    }

    }

    Then add this function to the header using:

    add_action( "genesis_site_title", "output_my_logo");

    I hope this helps.

    Chris


    Twitter: cehwitham Web: cehwitham.com

    #21053

    perplexed
    Participant
    Post count: 3

    Hi Chris,

    Thank you for your explination. I’m afraid that I’m still missing something.

    Here’s what I added to functions.php:

    /** Replace Site Title & Description with logo widget area */
    remove_action( ‘genesis_site_title’, ‘genesis_seo_site_title’ );
    remove_action( ‘genesis_site_description’, ‘genesis_seo_site_description’ );
    function output_my_logo(){
    if ( !function_exists( ‘dynamic_sidebar’ ) || !dynamic_sidebar( ‘logo’ ) ) {
    }
    }
    add_action( ‘genesis_site_title’, ‘output_my_logo’);

     

    And I registered the sidebar:

    genesis_register_sidebar( array(
    ‘id’ => ‘logo’,
    ‘name’ => __( ‘Logo’, ‘magazine’ ),
    ‘description’ => __( ‘This is the logo.’, ‘magazine’ ),
    ) );

     

    I see the logo widget in the backend, and I added content to it, but it doesn’t show. Have I missed a step?

    #21068

    braddalton
    Participant
    Post count: 7465

    There’s a plugin for multiple header images: http://wordpress.org/extend/plugins/wp-display-header/

    You could also add the logos to a transparent background.

    Another option is the Genesis Simple Headers plugin http://wordpress.org/extend/plugins/genesis-simple-headers/screenshots/


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #21121

    cehwitham
    Participant
    Post count: 396

    Can you check that the single quotes mark has copied ok to your functions.php file?

    It’s showing in your post as ‘ instead of ‘ sometimes makes a difference.

    It’s good if you can add it, there may be an error in the code I posted for the output. Can you see if it works if you change it to:

    function output_my_logo(){
    dynamic_sidebar( 'logo' );
    }
    add_action( 'genesis_site_title', 'output_my_logo');


    Twitter: cehwitham Web: cehwitham.com

    #21160

    perplexed
    Participant
    Post count: 3

    Hi Chris,

    No luck. I decided to give up and use a header image instead. Thanks for your help!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.