- This topic has 11 replies, 3 voices, and was last updated 2 years, 1 month ago by
David.
-
AuthorPosts
-
March 27, 2019 at 7:17 am #851483
Daniele
Hi all,
I’m tring to find a solution to put my primary menu inside the content.
as here: http://www.80s.it/wp-content/uploads/2019/03/Senza-titolo-2.pngany idea?
tnx in advance,Daniele
In love with GeneratePress
GeneratePress 2.2.2GP Premium 1.7.8March 27, 2019 at 3:31 pm #851875Tom
Lead DeveloperLead DeveloperHi there,
This should be pretty easy.
Try this PHP:
add_filter( 'generate_navigation_location', function() { return 'custom'; } ); add_action( 'generate_before_main_content', function() { if ( function_exists( 'generate_navigation_position' ) ) { generate_navigation_position(); } }, 1 );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 27, 2019 at 5:52 pm #851953Daniele
Hi Tom,
it seems working properly just on pages (please see http://www.80s.it/contatti/ ) but on the homepage the menu is hidden by the content and in blog pages the menu is showed in the header.I tried to put your code in a hook (i thought the hook would be the easiest way to show the menu, even because in the future i could choose to use it on the top of the sidebars) but it doesn’t work at all…
In love with GeneratePress
March 28, 2019 at 8:41 am #852633Tom
Lead DeveloperLead DeveloperI just updated the code above – can you give it another shot?
It should be added using one of these methods: https://docs.generatepress.com/article/adding-php/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 28, 2019 at 10:31 am #852745Daniele
๐ It is just as perfect as usual.
Just to be clear, i’ve added the code inside the functions.php file, but i was just figuring out if that code, modified like that
add_filter( 'generate_navigation_location', function() { return 'custom'; } ); add_action( 'generate_before_right_sidebar', function() { if ( function_exists( 'generate_navigation_position' ) ) { generate_navigation_position(); } }, 1 );
would easily work as well in other part of the website using hooks.
I’ll try.Thanks again and have a nice day,
DanieleIn love with GeneratePress
March 28, 2019 at 2:47 pm #852906Tom
Lead DeveloperLead DeveloperGlad I could help! ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 20, 2021 at 12:07 pm #1665963Gulf State Software
This code is not working for my themes. This is the website https://www.gulfstatesoftware.com/.
First I use function.php then I’m using code snippet. But nothing works.
-ThanksFebruary 20, 2021 at 2:53 pm #1666041Leo
StaffCustomer SupportDo you have the navigation as a header option enabled?
If so can you disable it first?
https://docs.generatepress.com/article/navigation-as-a-header/Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 20, 2021 at 4:46 pm #1666111Gulf State Software
Looks like process is change with the development of theme.
-Thanks a lot.February 20, 2021 at 4:56 pm #1666123Leo
StaffCustomer SupportSounds good.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 24, 2021 at 4:05 pm #1671372Gulf State Software
Sorry , I disable the navigation header , but now if I past the code in function.php, they navigation bar went out.
February 25, 2021 at 1:19 am #1671716David
StaffCustomer SupportHi there,
this is quite an old topic and since then there have been some changes… and i am not sure if that code is what you would need today – the code is removing the nav from its current location and placing it before the Right Sidebar… which your site is not using.
Could you raise a new topic and explain exactly where you want the navigation to be positioned and we’ll work that out
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.