blog is being set to current_page_parent

Home Forums Calendar Products Events Calendar PRO blog is being set to current_page_parent

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #811432
    wildheart
    Participant

    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,
    Guy

    #812410
    Geoff
    Member

    Hi 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!
    Geoff

    #813550
    wildheart
    Participant

    Hi 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

    #814360
    Geoff
    Member

    Great, 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!
    Geoff

    #828363
    wildheart
    Participant

    Thanks 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

    #829640
    Geoff
    Member

    Hey 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!
    Geoff

    #831527
    wildheart
    Participant

    Hi 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.

    #832455
    Geoff
    Member

    Hey 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,
    Geoff

    #835316
    wildheart
    Participant

    Thanks so much for your help Geoff.
    First class support!

    #840644
    Geoff
    Member

    My 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

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘blog is being set to current_page_parent’ is closed to new replies.