Add header left widget Minimum 2.0

Community Forums Forums Design Tips and Tricks Add header left widget Minimum 2.0

This topic is: not resolved

This topic contains 16 replies, has 3 voices, and was last updated by  braddalton 12 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #44340

    genevishgraphics
    Participant
    Post count: 52

    I would like to add a header left widget area to the Minimum 2.0 theme. I added
    `genesis_register_sidebar( array(
    ‘id’ => ‘header-left’,
    ‘name’ => __( ‘Header Left’, ‘minimum’ ),
    ‘description’ => __( ‘Header left widget area’, ‘minimum’ ),
    ) );

    add_action( ‘genesis_header’, ‘minimum_left_header_widget’, 11 );
    function minimums_left_header_widget() {
    if (is_active_sidebar( ‘header-left’ ) ) {
    echo ”;
    dynamic_sidebar( ‘header-left’ );
    echo ‘‘;
    }}
    `
    to my functions file and the left widget does appear in the back end, but when I add anything there, it does not displat on the front end. I did add a smaller version of the logo to the header to accomodate for the new widget area, but it still does not appear. I am sure I am missing something, I just dont know what it is!!

    –Update I saw a typo and changed
    `’minimum_left_header_widget’, 11`
    to
    `’minimum_header_left_widget’, 11 `
    I see the widget area appear in visual hook guide, but the content is not showing up – I think it has to do with my header covering it up??? How can I specify a new header image that is not FULL WIDTH>?

    #44371

    braddalton
    Participant
    Post count: 9805

    Your function name doesn’t match.

    Try this

    You’ll also need to add some CSS and make some changes to your title area.

    Code not displaying? Grab it from Github.


    #44372

    genevishgraphics
    Participant
    Post count: 52

    Yippeee thanks Brad!!!

    #44995

    genevishgraphics
    Participant
    Post count: 52

    One question – how would I remove this widget ONLY from the custom blog template I have created?

    #44996

    braddalton
    Participant
    Post count: 9805

    You would add a conditional tag to exclude the widget from displaying or install the Widget Logic plugin and do the same thing.


    #45001

    genevishgraphics
    Participant
    Post count: 52

    that is what I am struggling with – What is the right conditional tag? to only exclude the blog pages? Thanks for your help brad. I’m learning!

    #45005

    genevishgraphics
    Participant
    Post count: 52

    NM – got it – Just added the plugin and entered in !is_page(‘blog’) and now the left header is on all my pages but the blog pages :)

    #45008

    braddalton
    Participant
    Post count: 9805

    You learn fast!

    Alternatively, you could add the conditional tag to the code above:
    [php]
    if (!is_page(‘blog’) && is_active_sidebar( ‘header-left’ ) ) {
    [/php]


    #45029

    genevishgraphics
    Participant
    Post count: 52

    Of course! Why didnt I think of that?? :) Thanks Brad!

    #45032

    genevishgraphics
    Participant
    Post count: 52

    I have another question, and I am looking at your website for the answer but cant find it. I am adding a custom body class to my blog page, so I have have an alternate header image for the blog page- BUT I need that alternate image to be on all the blog posts and category pages as well. This would be a conditional tag issue again, I am using this
    `
    // Add custom body class to the head
    add_filter( ‘body_class’, ‘minimum_add_body_class’ );
    function minimum_add_body_class( $classes ) {
    $classes[] = ‘page_blog’;
    if(is_archive() ) {
    return $classes;
    }
    }
    `
    and now the correct header is there on the blog page, but it is duplicated with the other site header, and the post and category pages only have the old header instead of the “blog” header

    #45041

    braddalton
    Participant
    Post count: 9805

    Try this.

    No need for a custom body class.

    Code not displaying? Grab it on Github.


    #45108

    genevishgraphics
    Participant
    Post count: 52

    Yes but if I want to customize the background color etc as well I have to use custom body class right?
    Why won’t adding
    `
    if ( is_archive()) work?`

    #45182

    braddalton
    Participant
    Post count: 9805

    That’s another question.

    The one i answered relates to different header images on different pages.

    Personally i think you get more control over header images by using PHP rather than CSS or the custom header uploader to display them in your theme.

    You can add a custom body class if you want to or use the existing body class which you can grab from the source code.


    #63924

    zmel
    Participant
    Post count: 31

    Header left widget! Brad, thanks so much for the code! I was looking for this for days.

    #63928

    braddalton
    Participant
    Post count: 9805

    You could also change the float right to float left in the CSS code for the existing header right widget.


Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.