-
chetanpatil
Hi, I’m trying to add a menu on some pages using hooks.
I have added the below code<div class="second-nav"> <?php if ( function_exists( 'generate_secondary_navigation_position' ) ) { generate_secondary_navigation_position(); } ?> </div>Issue is no matter what i add in the hook, it is not getting visible for non logged in users. but this appears for logged in users.
My website name: http://www.git.edu
example page: https://git.edu/bachelor-of-science/bsc-departments/
here you cannot see the secondary menu but you can see it in below screenshot,
below are screenshots.,
https://postimg.cc/KkFKFb58
https://postimg.cc/VS7ysBqJLet me know if you need login credentials.
Regards
-
Alvind
Hi there,
What’s the hook name you used on the element?
-
chetanpatil
Here is the hook details:
https://i.postimg.cc/9XtkkFPk/image.png -
I’ve checked the element settings, and there’s no apparent reason it shouldn’t display on the frontend. Do you have a staging site where you can safely deactivate all plugins to test for a potential plugin conflict?
-
chetanpatil
We Do not have a staging site. We can create a new one if you say.
-
Alvind
It would be great if you could create a staging site so we can debug without the risk of breaking anything on the live site.
-
chetanpatil
Can you check and debug here:
https://ruminatee.com/This is safe for debugging.
-
The issue is that your site is built with Elementor, and GP hooks only work in GP’s default template.
Since you are using an Elementor header, so
generate_after_headerhook does not exist on your site.I’ve changed it togenerate_inside_containerand it works.Here’s the hook visual guide, hope it helps:
https://docs.generatepress.com/wp-content/uploads/2018/07/hooks-postspage.png -
chetanpatil
I checked but cant see it anywhere. can you share the screenshot?
-
Alvind
Hi there,
The issue is caused by the PublishPress Permissions plugin. I deactivated it, and the navigation is now displaying correctly.
- You must be logged in to reply to this topic.