• 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

Adding Middle Header Widget – Beautiful Pro Theme

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 › Adding Middle Header Widget – Beautiful Pro Theme

This topic is: resolved

Tagged: Add Widget, beautiful pro, header widget, middle header widget

  • This topic has 8 replies, 3 voices, and was last updated 5 years, 2 months ago by Captain Dynamo.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • February 28, 2020 at 5:19 am #497015
    Captain Dynamo
    Participant

    https://www.evakona.jp/blog/

    I'm trying to add a Middle Header Widget. I've tried various options but they don't seem to work.

    OPTION 1:

    1) Registered the widget.

    genesis_register_sidebar( array(
    'id' => 'middle-header',
    'name' => __( 'Middle Header', 'beautiful' ),
    'description' => __( 'This is the middle header widget', 'beautiful' ),
    ) );

    2) Added widget to the header.

    genesis_widget_area( 'after-entry', array(
    'before' => '<div class="middle-header widget-area">',
    'after' => '</div>',
    ) );

    OPTION 2:

    1) Register the widget.

    genesis_register_sidebar( array(
    'id' => 'middle-header',
    'name' => __( 'Middle Header', 'beautiful' ),
    'description' => __( 'This is the middle header widget', 'beautiful' ),
    ) );

    2) Replace header with new header (The below code works for evakona.jp homepage, but does not work for evakona.jp/blog homepage):

    -------------------------------------------------------------

    //* Add in the new header with the middle widget header
    function themeprefix_genesis_do_header() {
    global $wp_registered_sidebars;

    genesis_markup( array(
    'html5' => '<div %s>',
    'xhtml' => '<div id="title-area">',
    'context' => 'title-area',
    ) );

    do_action( 'genesis_site_title' );
    do_action( 'genesis_site_description' );
    echo '</div>';

    genesis_widget_area( 'header-middle', array(
    'before' => '<div class="widget-area header-widget-area">',
    'after' => '</div>',
    ) );

    if ( ( isset( $wp_registered_sidebars['header-right'] ) && is_active_sidebar( 'header-right' ) ) || has_action( 'genesis_header_right' ) ) {
    genesis_markup( array(
    'html5' => '<div %s>',
    'xhtml' => '<div class="widget-area header-widget-area">',
    'context' => 'header-widget-area',
    ) );
    do_action( 'genesis_header_right' );
    add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
    add_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );
    dynamic_sidebar( 'header-right' );
    remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
    remove_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );

    genesis_markup( array(
    'html5' => '</div>',
    'xhtml' => '</div>',
    ) );
    }
    }
    //* Remove the old header
    remove_action( 'genesis_header','genesis_do_header' );
    //* Add in the new header above
    add_action( 'genesis_header', 'themeprefix_genesis_do_header' );

    -------------------------------------------------------------------------

    http://www.evakona.jp/blog
    February 28, 2020 at 6:27 am #497016
    AnitaC
    Keymaster

    Try Neil's tutorial here.


    Need help with customization or troubleshooting? Reach out to me.

    February 28, 2020 at 6:29 am #497017
    Captain Dynamo
    Participant

    Hi Anita,

    I tried the coding and it did not work. If there is any alternative, please let me know.

    Regards.

    February 28, 2020 at 6:37 am #497019
    AnitaC
    Keymaster

    There are several tutorials out on the web.


    Need help with customization or troubleshooting? Reach out to me.

    February 28, 2020 at 6:39 am #497020
    Captain Dynamo
    Participant

    Yup,

    That's the first thing I typed in. If somebody could take a look at the coding I posted, would be nice.

    Thanks.

    February 28, 2020 at 9:03 am #497023
    Brad Dalton
    Participant

    I assume you want to add something between the title/logo and nav menu?

    Another method would be to add your widget to the header right widget area and position the content in the middle using CSS.


    Tutorials for StudioPress Themes.

    February 28, 2020 at 5:03 pm #497033
    Captain Dynamo
    Participant

    No.

    I'm trying to add a Middle Header Widget between the title/logo and social media icons (which are floated to the right).

    Regards.

    February 28, 2020 at 5:08 pm #497034
    Captain Dynamo
    Participant

    Just to retiterate, the following code I am using for http://www.evakona.jp to create a Middle Header Widget, but does not seem to work for http://www.evakona.jp/blog:

    --------------------------

    //* ADD MIDDLE WIDGET AREA

    add_action( 'widgets_init', 'genesischild_extra_widgets' );
    //Register in new Widget areas
    function genesischild_extra_widgets() {
    genesis_register_sidebar( array(
    'id' => 'header-middle',
    'name' => __( 'Header Middle', 'genesischild' ),
    'description' => __( 'This is the Header Middle area', 'genesischild' ),
    ) );
    }

    //* Add in the new header with the middle widget header
    function themeprefix_genesis_do_header() {
    global $wp_registered_sidebars;

    genesis_markup( array(
    'html5' => '<div %s>',
    'xhtml' => '<div id="title-area">',
    'context' => 'title-area',
    ) );

    do_action( 'genesis_site_title' );
    do_action( 'genesis_site_description' );
    echo '</div>';

    genesis_widget_area( 'header-middle', array(
    'before' => '<aside class="header-middle widget-area header-widget-area">',
    'after' => '</aside>',
    ) );

    if ( ( isset( $wp_registered_sidebars['header-right'] ) && is_active_sidebar( 'header-right' ) ) || has_action( 'genesis_header_right' ) ) {
    genesis_markup( array(
    'html5' => '<aside %s>',
    'xhtml' => '<div class="widget-area header-widget-area">',
    'context' => 'header-widget-area',
    ) );
    do_action( 'genesis_header_right' );
    add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
    add_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );
    dynamic_sidebar( 'header-right' );
    remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
    remove_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );

    genesis_markup( array(
    'html5' => '</aside>',
    'xhtml' => '</div>',
    ) );
    }
    }
    //* Remove the old header
    remove_action( 'genesis_header','genesis_do_header' );
    //* Add in the new header above
    add_action( 'genesis_header', 'themeprefix_genesis_do_header' );

    -----------------------------------

    February 28, 2020 at 6:28 pm #497035
    Captain Dynamo
    Participant

    Sorry to bother you all.

    I've found the solution! It is simply a matter of adding text to the widget to enable it.

    All solved.

    Regards.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Adding Middle Header Widget – Beautiful Pro Theme’ is closed to new replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 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