• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Arranging Widget Area order

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Arranging Widget Area order

This topic is: not resolved

Tagged: Arranging Widget Area order

  • This topic has 11 replies, 2 voices, and was last updated 8 years, 6 months ago by PhilMurray.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • August 9, 2014 at 11:43 am #117934
    PhilMurray
    Participant

    hi

    I have added 2 new WIDGET AREAS both registered in my functions.php using 'genesis_after_header'

    now what is happening is the PRIMARY NAV is getting pushed below these two new widgets.

    so i assume the PRIMARY NAV must also be registered to 'genesis_after_header' in the core code?

    so is there anyway I can order the widget areas so I can control which one appears second and third -- i want the PRIMARY NAV to be the first directly below the header

    i noticed that in my functions.php there is no reference to the primary-nav or menus so I am assuming it is built into the core code -- i am building a new child theme based on the genesis sample child theme

    thanks

    Phil

    August 9, 2014 at 12:37 pm #117946
    JanHoek
    Participant

    Use number order like

    add_action( 'genesis_after_header', 'your_widget', 3 );
    
    add_action( 'genesis_after_header', 'your_widget', 6 );
    
    add_action( 'genesis_after_header', 'your_widget', 8 );

    also place them in order in your functions.php


    Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.

    August 9, 2014 at 12:44 pm #117951
    PhilMurray
    Participant

    Thanks Jan --- i will try that

    but do I need to add something in functions.php for the PRIMARY NAV also? is it registered as 'genesis_after_header' too in the core code? or will it always sit directly below the HEADER anyway even if other widgets are added to 'genesis_after_header' ?

    also - i have styled the WIDGETS with background colours - but if the widget is not used [ie: has nothing in it] the backgroudn colour is still showing up on the site - how do I have the widgets NOT show up on the site unless they are being used?

    thanks

    Phil

    August 9, 2014 at 12:49 pm #117954
    JanHoek
    Participant

    I think the nav is ok. Wich code thit you use to register and show the widget-area?


    Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.

    August 9, 2014 at 12:53 pm #117957
    PhilMurray
    Participant

    hi Jan

    this is one of them

    thanks

    Phil

    /** Register Widget Area */

    genesis_register_sidebar( array(
    'id' => 'widget_before_content',
    'name' => __( 'Homepage Below Menu' ),
    'description' => __( 'This is below the bottom menu of the homepage.' ),
    ) );

    /** Add Slider Widget Area */

    add_action( 'genesis_after_header', 'widget_before_content' , 3);
    function widget_before_content() {
    echo '<div class="widget_before_content">';
    dynamic_sidebar( 'widget_before_content' );
    echo '</div>';
    }

    August 9, 2014 at 1:07 pm #117962
    JanHoek
    Participant

    Try to register them this way

    genesis_register_widget_area ( array(
    	'id' => 'widget_before_content',
    	'name' => __( 'Homepage Below Menu', 'childtheme' ),
    	'description' =>  __( 'This is below the bottom menu of the homepage.', 'childtheme' ),
    ) );
    
    add_action( 'genesis_after_header', 'widget_before_content' , 3);
    function widget_before_content() {
    		genesis_widget_area( 'widget_before_content', array(
    		'before' => '<div class="widget_before_content">',
    		'after'  => '</div>',
    		) );
    }

    Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.

    August 9, 2014 at 1:39 pm #117972
    PhilMurray
    Participant

    Thanks a lot Jan - will do

    where it says 'childtheme' - do i place the name of the childtheme in there or leave it as 'childtheme' ?

    thanks

    Phil

    August 9, 2014 at 1:44 pm #117976
    JanHoek
    Participant

    Your childthemes name


    Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.

    August 9, 2014 at 3:45 pm #117995
    PhilMurray
    Participant
    This reply has been marked as private.
    August 9, 2014 at 3:50 pm #117996
    PhilMurray
    Participant

    hi Jan

    i tried that but the widget gets added above the PRIMARY NAV --- so looks like giving it an order ID is causing it to not sit below the NAV

    So do I need to give the PRIMARY NAV an order ID of it's own?

    if so - how?

    thanks

    Phil

    August 9, 2014 at 3:58 pm #117997
    JanHoek
    Participant

    No. Use higher numbers in widgets-area. Like 12 and 15. The default of de nav is 10.


    Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.

    August 9, 2014 at 4:08 pm #117998
    PhilMurray
    Participant

    brilliant Jan - thanks - worked a treat

    cheers

    Phil

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble