Mini calendar not marking all days

Home Forums Calendar Products Events Calendar PRO Mini calendar not marking all days

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #997979
    Nicholas
    Participant

    My mini calendar (integrated via the [tribe_mini_calendar] short code) does not mark all the events on the calendar. It will show the events in list view below it but it only marks the first event of that month on the calendar. I’ve tried switching to the twentyfourteen theme, deactivating plug-ins, etc and it’s still doing the same thing. I found an old thread where someone was having a similar problem and you mentioned it had something to do with the “Recurring event instances” check box but I have checked and unchecked that box and it does not make a difference. Any ideas of what could be causing this?

    #998068
    George
    Participant

    Hey Nicholas – great avatar 🙂

    Can you link to a page on your site where we can see this calendar widget issue live? That might reveal some more information about this.

    Thanks!
    George

    #998878
    Nicholas
    Participant

    This reply is private.

    #999024
    George
    Participant

    Thanks Nicholas!

    Hm, this is an odd issue. I’m curious – can you try adding the mini calendar widget via the actual little widget module itself, instead of the shortcode? I’m wondering if they behave any differently on your site…

    Thank you!
    George

    #999208
    Nicholas
    Participant

    Yeah check the same page again – I added it via the widget and it’s doing the same thing.

    #999434
    George
    Participant

    Nicholas, I appreciate your patience with this issue. I’ve been trying to recreate this issue on my local site but, for the life of me, can not do it!

    I also don’t see anything in our code that could lead to this bug, nor think of something else other than a code conflict.

    So, from here the only troubleshooting step worth trying is to run through the full set of troubleshooting steps here → https://theeventscalendar.com/knowledgebase/testing-for-conflicts/

    However, you wrote that you’d already tried doing this, to no avail.

    Would you, by any chance, be able to put your site back in the state where a default theme is active and all other plugins are deactivated, and let us have another look at this page on your site?

    Finally, for now, in your original post you wrote this:

    I found an old thread where someone was having a similar problem and you mentioned it had something to do with the “Recurring event instances” check box

    Any chance you could find that original thread? No worries if not! Just curious to see what the issue was there.

    I’m really about this bug, Nicholas, I cannot recreate this with any combination of plugins or WordPress versions or anything I’ve tried so far. Thanks a ton for your patience and politeness so far, it means a lot!

    — George

    #999627
    Nicholas
    Participant

    Thanks for looking into this George. I figured out why the events weren’t being marked on the calendar – the client checked the “Hide from event listings” box because they do not want those specific events to appear on the main feed. It was throwing me off that the events are being listed below but not marked on the calendar… I unchecked all the events that were marked “Hide from event listings” and it’s working as should.

    However, this brings me to another issue. We need to be able to hide these events from the main feed. How can I hide events from the main events landing page/upcoming events, etc but still be able to view them in the category view? So for example they would need to appear if I go to /events/category/titlehere or through a widget/shortcode with a category specified but not in /events.

    Thanks again for your help.

    #999650
    George
    Participant

    Hey Nicholas,

    Damn, sorry I didn’t even think of asking about the “Hide from event listings” option! I’m glad you found that to be the culprit though 🙂

    I unfortunately have some bad news about your question here, though:

    How can I hide events from the main events landing page/upcoming events, etc but still be able to view them in the category view?

    This would unfortunately require custom code. The only way I can think of doing that would be to query for all events marked as “hidden”, then use pre_get_posts() to filter out these posts via the post__not_in query var and hope that that does the trick.

    Are you familiar with these things, and with making such customizations on your site? They’re a bit outside the scope of the forums so I can’t write the whole functionality, but if you’re interested in learning more I can try to share some more information on how, exactly, this would manifest in theory.

    Sorry to disappoint Nicholas – let me know what you think!

    — George

    #1000022
    Nicholas
    Participant

    Yes, any ideas would be greatly appreciated. I’m not the best programmer but if I can’t do it I can at least point of our more “backend programmy” guys in the right direction.

    #1000697
    George
    Participant

    Sounds good Nicholas. I appreciate your patience here over the weekend, and while I’m not the best programmer myself, I hopefully can recommend something useful here: the mighty tax_query query parameter for WP_Querys everywhere.

    Essentially, tax_query lets you specify taxonomy-related sub-queries within the “main” query on a WordPress page. Pretty neat. It’ll be useful here because it includes a “NOT_IN” operator, which as its implies basically says “return everything, but exclude if NOT_IN this category”.

    Something along the lines of this, for example:

    add_action( 'pre_get_posts', 'nicholas_example_pre_get_posts' );

    function nicholas_example_pre_get_posts( $query ) {

    if ( is_admin() ) {
    return $query;
    }

    // Other rules here to check for what page you're on...just return $query early on pages where you don't want this to run, like in the admin as seen above.

    // For example, to return $query on Events Category archive pages (so that nothing is excluded):

    if ( $query->is_tax( 'tribe_events_cat' ) ) {
    return $query;
    }

    // If the code has made it this far along without hitting a "return $query", then we can add the tax_query:

    $exclude_cat_query = array(
    array(
    'taxonomy' => 'tribe_events_cat',
    'field' => 'slug',
    'terms' => array( 'highlights' ),
    'operator' => 'NOT IN'
    )
    );

    $query->set( 'tax_query', $exclude_cat_query );

    return $query;
    }

    This code will add a tax_query which excludes the Event Category called “highlights” from all pages except Events Category archive pages…

    I hope this is a good starting point. Please definitely give the following things a read, or at least the “backend programmy” person you rope in for this 🙂

    • more on pre_get_posts() → https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
    • more on WP_Query which includes tax_query → https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
    • another similar example I found out in the wild → http://wordpress.stackexchange.com/a/35263

    Best of luck with this Nicholas! Let me know if there’s anything else I can help with or if you have any other questions here.

    Cheers,
    George

    #1001052
    Nicholas
    Participant

    Thanks that does help. I do have one more question. One of the developers on our team was able to accomplish what I was looking for by making a number of modifications to the the-events-calendar/src/Tribe/Query.php file. Is there a way I can include my version of the Query.php in the theme so I can update the plug-in without losing the modified query?

    #1001439
    George
    Participant

    Hey Nicholas,

    There is unfortunately not a way to do that – at least, no method for it that our plugin will handle on its own, like with our /views/ templating system 🙁

    One of the simplest things that MIGHT work is to simply proceed with adding the file in your theme anyway, and using the same name as the “official” class – Tribe__Events__Query.

    This is because the “official” does a class_exists() check first before defining itself:


    if ( ! class_exists( 'Tribe__Events__Query' ) ) {
    class Tribe__Events__Query {

    So that might work, but it’s still far from “endorsed” and not quite recommended.

    I hope that helps!

    — George

    #1005922
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Mini calendar not marking all days’ is closed to new replies.