Archived topic
Changing the Top Bar Position
5 replies · Started by Marcel Kuhla on June 1, 2019
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
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 );
} );
That actually worked (as expected).
Thanks David :)
You can take that into the Documentation tbh :)
Awesome - never thought of trying that before - so thanks for asking :) Ill see if we can find a home for it in the docs.
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?
Hi Fred,
Try one of the methods that are mentioned in this article to add PHP code:
https://docs.generatepress.com/article/adding-php/