[Resolved] Changing the Top Bar Position

Home Forums Support [Resolved] Changing the Top Bar Position

Home Forums Support Changing the Top Bar Position

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #917168
    Marcel Kuhla

    Hello Guys,

    I want to use the Top Bar, but I want to change the position. I know that a Top bar is supposed to be “on top” but I want the Top Bar to be under header.

    Is that possible with minimal coding?

    I’m already using the “offical” Child Theme with the FontAwesome Hook so there I can play around with it.

    Regards,

    Marcel

    #917189
    David
    Staff
    Customer Support

    Hi there,

    you could try this function to unhook the topbar and hook it after the header:

    add_action( 'after_setup_theme', function() {
        remove_action( 'generate_before_header', 'generate_top_bar', 5 );
        add_action( 'generate_after_header', 'generate_top_bar', 5 );
    } );
    #917192
    Marcel Kuhla

    That actually worked (as expected).

    Thanks David πŸ™‚

    You can take that into the Documentation tbh πŸ™‚

    #917193
    David
    Staff
    Customer Support

    Awesome – never thought of trying that before – so thanks for asking πŸ™‚ Ill see if we can find a home for it in the docs.

    #1958844
    Fred

    Hi, I would like to do this too, but I’m unsure as to how to exactly. I dropped the function as suggested in a new ‘generate_header’ hook but it only displays the line of code under the header. I guess I need to wrap this function into some php?

    #1959175
    Ying
    Staff
    Customer Support

    Hi Fred,

    Try one of the methods that are mentioned in this article to add PHP code:
    https://docs.generatepress.com/article/adding-php/

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.