Archived topic
how to place menu items to the right of the search bar?
9 replies · Started by WPguy on February 2, 2023
Hi,
Could you please let me know how can I place menu items to the right of the search bar?
The screenshot and details are attached.
Thanks
Hi there,
For the account, you can use the same hook as the search, generate_after_header_content.
For the cart icon, try adding this PHP snippet to move it to generate_after_header_content hook as well:
add_action('generate_after_header_content','generate_wc_do_cart_menu_item',10);
remove_action( 'wp', 'generatepress_wc_add_menu_bar_items',10 );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Thanks, Ying,
Cart icon: I added the PHP snippet and it worked. But the cart icon appears before the search bar. How to place it after the search bar?
The account: What shall be the div class for me to create the hook?
Thank you!
Hello there,
Try adding this through Appearance > Customize > Additional CSS:
header span.menu-bar-item.wc-menu-item {
order: 1;
}
Thanks, Fernando!
You're welcome!
Sorry I have to re-open the topic as I still need to get the answer to the question above:
The account: What shall be the div class for me to create the hook?
Thanks
The account: What shall be the div class for me to create the hook?
Not sure I understand your question, the Account is currently in a hook element, you just need to change the hook from generate_menu_bar_itemto generate_after_header_content.
Thanks, Ying!
No Problem, glad to help :)