[Plugin: The Events Calendar] Grid calendar can’t show dates other than current month
-
I have installed the events calendar on a blog I’m doing for a golfer and he needs to put up all his events. Events show for January but when we select the month February from the drop down menu at the top it kicks out an error page and says what we are looking for is not there.
Is there a fix for this problem? What do I do? Please help it is urgent.
-
I believe my issue is also with the date picker.
I can see the current month, and its events. Then when I choose another month from the drop down menu nothing happens.
I was able to reproduce similar behavior of the issue summarized in my last post. Our plugin seems to not like other loops very much, a larger problem that needs dealt with (it’s officially added to the queue). When this happens, using wp_reset_query() in the right place or avoiding use of query_posts() and using WP_query() instead usually fixes the interference between loops. Not in the case of my tests. Feel free to experiment with those two solutions and please post the results here if it works. However, jasonnewlin’s hint at the get_posts() fix seems to be the only way. Here is an example:
1. find any other loop in your theme that ends up being displayed simultaneously with any events calendar view. (I bet many instances of this will occur in sidebar.php)
2. Replace that loop with a homemade loop where you use get_posts() directly. Like this:<?php global $post; $myposts = get_posts('[This is the query string from your original loop.]'); foreach($myposts as $post) : setup_postdata($post); ?> <!-- the loop body --> <?php endforeach; ?>
This was the only thing that allowed me to keep my other loop and the events calendar working.
Here it is in the WP documentation:
https://codex.www.ads-software.com/Template_Tags/get_postsThis is not a desirable or clean fix and is probably tough for non-developers so if someone comes up with a solution that can be implemented within the plugin code, please post. We’ll be looking at it in the meantime.
@kaichen and @thebushman
I started a new thread for your issue.
https://www.ads-software.com/support/topic/370749?replies=1Justin
hard…
I’m in the same boat here, and I can see too on some of the other people’s site examples that when trying to switch the calendar to a different month or year, it gets stuck in a loop saying its transfering data that eventually dies, but no change to the calendar grid view.
It took me a while to figure out how to trigger a calendar from a Page, and eventually I had to create a separate cloned template in my main directory as the ones in /events? didn’t show up in the Page tempalte drop down.
My example is here: https://develop.posseproject.ca/index.php/get-involved/events/ (temporary)
I have a news loop running in the sidebar which may be the conflict.
I’m confused, is there an events mini-calendar sidebar widget or only a sidebar list?Let me add that it is indeed the sidebar Calendar Event Widget that is causing the problem for me. If I eliminate that, so too goes the problem changing dates on the calendar.
I’m assuming that this is the section of code in the-events-calendar.php that is causing the problem when you enable tep’s sidebar Events List Widget”
/* Display list of events. */ if( function_exists( 'get_events' ) ) { $old_display = $wp_query->get('eventDisplay'); $wp_query->set('eventDisplay', 'upcoming'); $posts = get_events($limit); //print_r($posts); if ($posts) : echo "<ul class='upcoming'>"; foreach( $posts as $post ) : setup_postdata($post); if (file_exists(TEMPLATEPATH.'/events/events-list-load-widget-display.php') ) { include (TEMPLATEPATH.'/events/events-list-load-widget-display.php'); } else { include( dirname( __FILE__ ) . '/views/events-list-load-widget-display.php' ); } endforeach; echo "</ul>"; else: echo "no events"; endif; /* Display link to all events */ echo '<div class="dig-in"><a href="' . $event_url . '">' . __('View All Events', $this->pluginDomain ) . '</a></div>'; $wp_query->set('eventDisplay', $old_display); }
So using your example above, how would you change this code to avoid the loop conflict with the main calendar?
Thank you!
Justin,
I’m having trouble following all of the problems and fixes..
I didn’t have this problem when I looked at my calendar within the last couple of days.
I had added some plug ins but have now deactived them an the problem persists.
I’m using WP 2.9.2 and am using Atahualpa as my theme. I am using Advanced Category Excluder and Page Links plug ins in order to get my calendar displayed on a single page.
The Event List works if I click on it on my page but I can’t get it to come up as a default. The current month on the grid shows no events unless I switch to April and then back to March.
You can see it here https://mydailyearrings.com/category/events/.
I’m afraid of the fixes noted as I don’t know how it will work with the plug ins that I installed in order to get the calendar on one static page.
Sorry. I’m sort of freaking out a bit as I just went live this morning and disabled my old site.
My permalink structure is /%postname%/%category%/
Any help is greatly appreciated.
Pam
Hi again,
I somehow got the event list default working so I’m panicking less.
It occurs to me that the trouble can’t possibly be with the Events Calendar alone. Since I last saw my calendar working I have installed WP Super Cache, Google analytics and Google XML Sitemaps. I deactivated all of them and still no current month events on the calendar.
Otherwise, it’s been working fine since the initial install.
I’m thinking that the incompatibility might be with Sitemaps.
Just further clues I wanted to add.
Thanks
Hi Pam,
When I follow your above link to /category/events/, I get a list of events. It seems that either the list view is altered and set as default in the The Events Calendar settings panel, or the plugin is deactivated.
Yours seems to be a complex mix of bugs from multiple plugins, but visiting your site, I’m guessing the root of the problem is that your site has multiple displays of events on a page ( multiple post loops ). We didn’t take this case into consideration when building TEC, so as of now, it doesn’t support that scenario. This is a problem we’re still working on, and one that will most likely not have an easy fix.
Justin
Fixed mine by deleting the events widget from the sidebar on the grid page
Used widget logic plugin to exclude the upcoming events widget using
!in_category(“events”)
Not sure if this will help any of you but I was having this same problem with the Event List and trying to navigate in the calendar. I fixed the problem by making a child category “upcoming” to events. I hadnt seen that anywhere in the documentation or in the forum.
Good plugin.
confirming that the issue seems to be with the sidebar plugin – enabling and disabling fixes/re-introduces my error.
For the devs: My symptoms included ->
1. Could only see current month. URL structure etc. would be fine but calendar would not change to reflect month selected.
2. Only events with future end dates were shown. So if I had something from April 1 – April 3, and today was April 4 – the event would not be displayed on the calendar
Simply removing the sidebar plugin worked for me.
I experienced this same bug. My problem was caused by multiple loops as well. I had another loop in my header, I removed it and the calendar started working again.
I was able to use
get_posts();
instead ofquery_posts();
in the header and everything worked out fine.For reference: https://codex.www.ads-software.com/Template_Tags/get_posts
- The topic ‘[Plugin: The Events Calendar] Grid calendar can’t show dates other than current month’ is closed to new replies.