Home › Forums › Calendar Products › Community Events › Sticky Genesis menu not working
- This topic has 5 replies, 2 voices, and was last updated 10 years, 1 month ago by
George.
-
AuthorPosts
-
March 15, 2016 at 4:22 am #1088999
stefaanoyen
ParticipantHi there,
I use a sticky menu on my Genesis site (http://www.ooooooo.be/) per these instructions: http://my.studiopress.com/tutorials/sticky-menu/. It appears when you scroll down.
It works on all pages, except on the events pages (events archive and single events, for example http://www.ooooooo.be/events). It probably has something to do with the Genesis functions/hooks in the code? This is the code that goes into functions.php:
//* Enqueue sticky menu script add_action( 'wp_enqueue_scripts', 'sp_enqueue_script' ); function sp_enqueue_script() { wp_enqueue_script( 'sample-sticky-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/sticky-menu.js', array( 'jquery' ), '1.0.0' ); } //* Reposition the secondary navigation menu remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_before', 'genesis_do_subnav' );How do I get this to work on events pages as well?
Thanks for your support,
Stefaan-
This topic was modified 10 years, 1 month ago by
stefaanoyen.
March 15, 2016 at 8:34 am #1089079George
ParticipantHey Stefaan,
Thanks for reaching out! I cannot promise a full solution here, because this unfortunately is a limitation of the Genesis theme’s design choices—the genesis_before action being used there does not run in our plugins by default, so the main thing (or, at least, the first thing) to ensure is that the action runs on Events Calendar views.
To ensure this, there are a few things I can think of.
The simplest approach that I would first recommend exploring is just changing the “Events Template” option in your Events Calendar settings. There might be a template already in your theme that has the required Genesis actions.
To do this, head to Events → Settings in your wp-admin and find the option called “Events Template”. Try out every single option here—save changes after choosing a template, then check out the events page and see if the Genesis menu behaves any differently on your events page.
If the steps above do not help, then we can proceed with other testing.
However, one thing I’m curious about is if you can ensure that your events page is publicly viewable? I went to http://www.ooooooo.be/ and it was unfortunately a 404 error, no content was visible. 🙁 We cannot log into customer sites for any reason, so if possible, can you make your events page publicly viewable? I will take a look and see if I can spot any details relevant to your issues.
Thank you!
GeorgeMarch 16, 2016 at 1:54 am #1089557stefaanoyen
ParticipantHi George,
Thank you for your quick reply. No luck with the other templates though: they’re a mess : )
And sorry, I forgot to mention that the site is not live yet. As soon as we get live, I’ll get back to you for more testing. Thanks in advance!
Kind regards,
StefaanMarch 16, 2016 at 2:54 pm #1090020George
ParticipantThank you, Stefaan—do keep me posted on the site, and share a link when it’s live!
In the meantime, you might find some success by modifying the default events template file directly.
To learn how to make customized versions of The Events Calendar template files, check out this guide here → https://theeventscalendar.com/knowledgebase/themers-guide/
Then, using those principles, make a customized version of this plugin file in your theme:
the-events-calendar/src/views/default-template.phpThe default version is a pretty simple and basic file—what I suggest is adding the Genesis action that can be seen in your example code snippet (the genesis_before() action, specifically).
So, something like this might be a helpful customization of that file → https://git.io/va2jN
This might not resolve the issue, but is worth a shot. Some sort of customization like this will ultimately probably be required anyways. Let me know if this helps at all with the issues.
Thank you,
GeorgeMarch 24, 2016 at 10:51 am #1093551stefaanoyen
ParticipantHi George,
Your answer worked, menu is visible now : ) Thank you so much for your great support!
Kind regards,
StefaanMarch 24, 2016 at 11:23 am #1093584George
ParticipantGlad to hear it! 😀
Cheers,
George -
This topic was modified 10 years, 1 month ago by
-
AuthorPosts
- The topic ‘Sticky Genesis menu not working’ is closed to new replies.
