Home › Forums › Calendar Products › Events Calendar PRO › blog is being set to current_page_parent
- This topic has 9 replies, 2 voices, and was last updated 9 years, 6 months ago by Geoff.
-
AuthorPosts
-
October 14, 2014 at 8:18 pm #811432wildheartParticipant
Hi,
Love your plugin. Good work.
I notice that when I go to my events page that the blog menu item is being assigned the .current_page_parent class.
Check it out here: http://yogareading.co.uk/events/How do I remove this?
Thanks,
GuyOctober 15, 2014 at 9:07 am #812410GeoffMemberHi there, Guy! Welcome to the forums and thanks for the kind words. Sorry you’re running into some issues here, but hopefully I can help. ๐
Can you try setting the template for the calendar to “Default Events Template” (Events > Settings > Display) to see if that makes a difference? I want to narrow the issue down to see if it has something to do with the Canvas theme or your child theme.
Give that a try and let me know what you find. ๐
Cheers!
GeoffOctober 15, 2014 at 10:17 pm #813550wildheartParticipantHi Geoff,
Thanks for your help. I went in and had a look and it was already set to ‘Default Events Template’. I tried to ‘Default Page Template’ which meant all the lovely layout of the calendar disappeared but blog was also still selected. Switched it back now.Would you like a login to WP?
Cheers,
Guy
October 16, 2014 at 8:30 am #814360GeoffMemberGreat, thanks for giving that a shot and confirming the outcome for me!
Since the issue sticks around with the “Default Events Template” option selected, this tells me it likely has something to do with a conflict with the theme. For example, the theme is recognizing the Events template as a blog/archive template when it should not. It’s tough for me to tell because I’m not totally familiar with your theme.
As a workaround, you could use a little jQuery to remove the parent page class from Blog when Events is the current page. Something like:
if ( is_page( 'events' ) ) { echo '<script>'; echo '$("#menu-item-227").removeClass("current_page_parent"); echo '</script>' }
Alternatively, you could also reach out to the developer to see if they can provide any insight into why the Post Archive is displaying in this situation.
Give those suggestions a try and let me know if you have further questions. ๐
Cheers!
GeoffOctober 22, 2014 at 7:57 pm #828363wildheartParticipantThanks Geoff,
I’ve contacted the Woo Support team and waiting to hear back from the. In the meantime it would I to get your code snippet working. How do I insert it into my site?
I’ve tried adding it to the header.php as you provided it and it just prints out the statement also tried putting it into php tags and that kills the site.Thanks,
Guy
October 23, 2014 at 7:51 am #829640GeoffMemberHey Guy, thanks for following up!
Sorry, there was a missing quote in the snippet. You can drop it into your footer.php file or directly in the page template you want to affect (e.g. archive.php) and wrapped in PHP tags.
if ( is_page( 'events' ) ) { echo '<script>'; echo '$("#menu-item-227").removeClass("current_page_parent")'; echo '</script>' }
Cheers!
GeoffOctober 23, 2014 at 10:57 pm #831527wildheartParticipantHi Geoff,
Hi Geoff,Thanks, for your help.
I tried adding it to the footer and nothing happened. In fact when I viewed source of the rendered page that code didn’t show up.
I also tried adding your snippet to the archive page and same thing.
Finally tried adding it to the header both before and after body and it killed the site.October 24, 2014 at 7:41 am #832455GeoffMemberHey there, Guy!
That’s certainly odd. I’ve tested it out on my site (in footer.php) and it seems to do the trick. You may need to play around with it a bit to suit your specific theme, but the snippet should be a good starting point for you to get what you’re looking for while the theme developer responds with a more solid theme-level solution.
You can also create a template override of the default-template.php file for the plugin and drop the snippet in there without the PHP:
<script> $("#menu-item-227").removeClass("current_page_parent") </script>
To do that:
- Create a copy of theย default-template.php file (/plugins/the-events-calendar/views/default-template.php)
- Create a new folder in your theme directory calledย tribe-events and place the copied file in there
- Add the snippet to the file and save it
I hope this helps!
Cheers,
GeoffOctober 25, 2014 at 7:59 am #835316wildheartParticipantThanks so much for your help Geoff.
First class support!October 27, 2014 at 8:00 am #840644GeoffMemberMy pleasure! I’m so glad we were able to help. I’m going to go ahead and close this thread, but please feel free to hit us up with a new thread if any other questions pop up. We’d be happy to help. ๐
By the way, if you’re enjoying the plugin and have a moment, we’d love it if you shared your thoughts on it on our review page. It would be greatly appreciated!
Cheers,
Geoff -
AuthorPosts
- The topic ‘blog is being set to current_page_parent’ is closed to new replies.