Posted: July 27, 2023 at 1:38 pm
|
Hi,
Thanks in advanced. |
Hi there, My apologies, but I’m not really sure I follow what you are asking for. If you are asking how to check for EE events then you can use:
Is that what you are looking for? |
|
|
Hi Tony, |
Does the function you posted already do that, just not for EE events? |
|
|
This code is not working. Any suggestions here? |
Does the function you posted work for non EE events? |
|
|
No, it doesn’t do anything at all. |
Ok, so start from the beginning of the function and work out what isn’t working. First, make sure the filter is actually running. A quick an easy way is to just add something like:
As the first line of the hooked function and then make sure it when you view the menu on the front end it outputs all of the details you would expect. That also confirms that your filter is at least running. Then swap location to be within your conditionals and refresh. If you are on an EE event it should output the same thing, outside of an EE event, nothing. Is your theme actually calling a Menu that has been created within the dashboard? |
|
|
This reply has been marked as private. |
With no code changes at all, that code is doing exactly what you are requesting, it’s adding the Is there something different you are expecting? I suspect you need to also add the ‘active’ class:
|
|
|
Hi Tony, |
Awesome, I’m glad that worked 🙂 |
|
The support post ‘adding active class to menu-item when visiting cpt single event’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.