Blog and Archive Pages have class .current_page_parent when on Event pages

Home Forums Calendar Products Events Calendar PRO Blog and Archive Pages have class .current_page_parent when on Event pages

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #764909
    Christian Thomson
    Participant

    Hi there,
    I couldn’t find a solution for my issue, I hope it’s possible to fix?
    So, when I am viewing the Event pages, the Blog menu items are also assigned with the class .current_page_parent, so the CSS highlights both the Events page and the Blog page.
    I am using a custom menu, but no special parameters.
    register_nav_menus (‘primary’ => __( ‘Primary Menu’, ‘valleyfirstaid’ ));
    The site is still local on my MAMP. In the meantime, is there a solution you can think of?
    Thank you,
    Cintia

    #766233
    Geoff
    Member

    Hi there, Cintia. Welcome back to the forums. 🙂

    The pages/posts created by the calendar follow the same function used by default WordPress functionality, so they should be treated like any other page as far as changing the current item in the menu.

    I’m unable to see exactly what you’re referring to since this is on localhost, but I would imagine the current page class would work appropriately if the calendar is added to the menu in your Appearance > Menus settings and that the calendar is using the default event templates in Events > Settings > Display.

    If they aren’t, I wonder if you set the calendar templates to use one of your theme templates instead under Events > Settings > Display, and the template being used is causing the unexpected behavior. Is that possible?

    Cheers!
    Geoff

    #766582
    Christian Thomson
    Participant

    This reply is private.

    #769139
    Geoff
    Member

    Thanks for sharing the link! That’s super helpful.

    Are you using one of your theme’s templates to display the calendar? You can check under Events > Settings > Display > Events Template. If so, please try selecting “Default Events Template” and see if the menu is still highlighting both items.

    If that doesn’t work, are you able to activate the default WordPress Theme (e.g. Twenty Fourteen) to see if the issue is still there?

    Thanks!
    Geoff

    #769220
    Christian Thomson
    Participant

    Hi Geoff,
    I am already using the Default Events Template. I have switched to the TwentyFourteen theme, and I clicked on a single event page, and checked the class for my Blog page (Community Corner), and the blog page still has the class .current_page_parent assigned to it.
    Would it help if I gave you my login credentials to WP?
    Thanks!

    #783391
    Christian Thomson
    Participant

    Hi there, have you received my last message? The suggestions you gave me aren’t what’s causing the issue.
    I look forward to hearing from you soon.
    Thanks!

    #783844
    Geoff
    Member

    Hi there, Cintia! So sorry for the late reply. We made some updates to our system and this thread sort of slipped through the cracks. My apologies!

    Looking closer at your code, it appears that the Community Corner is set as the parent for the Courses page. In other words, it looks like somewhere down the line, you set the Courses page to be a subpage of Community Corner. The issue will go away once you have removed that hierarchy.

    Give that a shot and let me know what you find. 🙂

    Cheers!
    Geoff

    #783949
    Christian Thomson
    Participant

    Hi Geoff, thanks again for the help.
    So, I didn’t have a Courses page published, I only had a custom link “/courses” in the Menu, as this was the solution for the Courses menu to highlight when I’m on any of the events sub-pages.
    However, now I created a Courses page and replaced it on the menu, but the issue persists. Now, only the Community Corner is highlighted, and the Courses aren’t!
    Could this give you a hint at what could be causing the problem?
    Also, where else other than the Page Parent attributes could I not set the Courses page as a child page of the Community Corner Blog? Which it isn’t.
    I’ve checked the Events Calendar settings, but I can’t figure it out.
    Thanks for the ongoing help!
    Cintia

    #794164
    Geoff
    Member

    Hi there, Cintia! Thanks for the follow-up and additional information–it’s greatly appreciated.

    I’m having a tough time pinning down where the issue is since it seems to be specific to the theme.

    The best solution would be to solve it at the theme level. If that isn’t an option, you may be able to tackle it with some PHP/jQuery. Something like:

    if ( is_page( 'courses' ) ) {
    echo '<script>';
    echo '$("#menu-item-158").removeClass("current_page_parent");
    echo '$("#menu-item-261").addClass("current_page_parent");
    echo '</script>'
    }

    Again, that might not be the most elegant solution and you would need to tailor it to fit your needs, but that might get you closer to where you need to be.

    Sorry I’m unable to offer more with a theme conflict like this, but does that help you? Please let me know.

    Cheers!
    Geoff

    #794861
    Christian Thomson
    Participant

    Hi Geoff,
    Thanks for the reply. The issue I’m having is not theme related, as it also happens when I switch to the Twenty Fourteen theme.
    Do you have any other thoughts considering the problem isn’t in the theme?
    I appreciate you sending the PHP/jQuery fix in case no other solutions exist.
    Thanks!

    #808476
    Geoff
    Member

    Hi Cintia! I’m so sorry this is still a recurring issue for you.

    The weird thing is that I am unable to replicate the issue using the default WordPress Twenty Fourteen theme. Here is what I have done to test:

    • I set the calendar so its URL is /courses (under Events > Settings) to match your URL. (screenshot)
    • I checked that the calendar is set to use the Default Events template (under Events > Settings > Display) (screenshot)
    • I added a link to the calendar to my primary menu (under Appearance > Menus) (screenshot)
    • A created a new page called “Community Corner” using the default page template
    • I added the new “Community Corner” page to the primary menu (under Appearance > Menus) (screenshot)

    Once I did the above, I went to the events calendar page (/courses) of the site. The menu item for “Courses” was properly highlighted and the menu item for “Community Corner” was properly unhighlighted. Here’s a screenshot of that page.

    Is there something missing from above that should have been tested as well? Are you using a similar configuration? Please let me know. 🙂

    Cheers!
    Geoff

    #810767
    Christian Thomson
    Participant

    Hi Geoff, thank you so much for trying to replicate my issue and not giving up 🙂
    The only thing I think you may have missed in the replication is to set the Community Corner page as the Blog page in the Reading settings. Did you do that too?
    Thanks!

    #812987
    Christian Thomson
    Participant

    Hi Geoff,
    I found this thread about others having the same issue:
    https://wordpress.org/support/topic/incorrect-navigation-menu-item-highlighted-when-viewing-event-detail
    I tried deactivating the Event Calendar plugins, and then activating them one by one, and the issue happens when I activate “The Events Calendar”, not the PRO plugin.
    I hope you can figure it out 🙂

    #813056
    Geoff
    Member

    My pleasure, I’m happy to help. 🙂

    Thanks for clarifying! I just set the “Community Corner” page to display posts in my setup (screenshot) but am still unable to replicate the issue.

    At this point, I’d suggest temporarily activating the default Twenty Thirteen theme, to see if the issue happens there as well.

    If disabling the theme fixes it, that’s good news! It means we have narrowed the issue down to a theme conflict.

    If the issue is still there when using the default Twenty Thirteen theme, then we can try testing for conflicts with other installed plugins. Using the Twenty Thirteen, please try deactivating all of your plugins, except for the ones from Modern Tribe. Does that solve the problem? If so, reactivate the plugins one at a time until the issue pops back up, then tell me which one was causing the issue.

    These steps are also outlined here if you want some more details on how to test for conflicts.

    Give those steps a shot and let me know what you find.

    Cheers!
    Geoff

    #813078
    Christian Thomson
    Participant

    Hi Geoff,
    I did try deactivating the plugins, it appears to happen when I activate “The Events Calendar”.
    I think it’s all good now, I have used CSS to target the body “event-archive” class and remove/add the highlight for the ID of the Blog menu item.
    Thanks a lot for helping!

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Blog and Archive Pages have class .current_page_parent when on Event pages’ is closed to new replies.