Home › Forums › Calendar Products › Events Calendar PRO › Order events in main blog loop by post date (fails after updates)
- This topic has 17 replies, 3 voices, and was last updated 10 years, 5 months ago by
Support Droid.
-
AuthorPosts
-
October 11, 2015 at 11:30 am #1013535
Jim
ParticipantThe Tribe-recommended code to achieve this doesn’t work. I’ve seen other recent reports of this, typically mentioning the recent WP and TEC updates getting to to 4.3.1, but no solutions. It did work earlier but now fails – future events always appear at above blog posts. Site info to follow.
October 11, 2015 at 11:31 am #1013536Jim
ParticipantThis reply is private.
October 12, 2015 at 7:08 am #1013659Brian
MemberHi Jim,
Thanks for using our plugins I can help out here.
What version of the Events Calendar are you using?
It Core at 3.12.3 and Pro at 3.12.2.
If not can you please update to those versions and see if that helps.
Let me know and we can go from here.
Thanks
October 12, 2015 at 7:30 am #1013685Jim
ParticipantIt Core at 3.12.3 and Pro at 3.12.2.
Confirmed
Community is also installed at 3.12.2
October 12, 2015 at 7:32 am #1013688Jim
ParticipantThis reply is private.
October 12, 2015 at 1:40 pm #1013815Brian
MemberOk thanks.
I took a look at your home page and not sure what I am looking for.
Are the events suppose to appear under the latest updates?
Did they ever show there?
Let me know if I am in the right area and we can go from here.
Thanks
October 12, 2015 at 4:48 pm #1013915Jim
ParticipantThey will appear there but the actual blog page is at the link given previously: http://www.jimtovey.ca/news/
The events are output in the loop along with other blog posts when you select “Include events in main blog loop”. Unfortunately, TEC events are output by event date, meaning any future event is ALWAYS the first item in the blog. Ten future events? your blog starts on page 3 or so.
The other link I referenced (https://theeventscalendar.com/knowledgebase/order-events-in-main-blog-loop-by-post-date/) fixes this by outputting event posts by post date. The code provided fails, also as tested with twenty-fourteen and no other plugins. This is the problem – was working up until the slew of recent updates for WP and TEC.
(A suggestion for improvement would be to add this as a user selectable option, right underneath “Include events in main blog loop”.)
October 13, 2015 at 6:55 am #1014054Brian
MemberHi,
I looked at that page and see two events and see what you mean.
I not sure the coding was ever intended to work on a sub page as we usually meant that to be on the home page of the site as that is usually the main loop.
The snippet works for me when testing on my home page. I cannot get a sub page to be considered the main loop.
I also use Genesis, which your theme is a child theme of and the standard blog page does not show events for me.
Do you have the coding that makes that page to be considered a main loop? I can try to help out if I have that, but otherwise I do not have anything else to fix it.
Let me know.
Thanks
October 14, 2015 at 11:15 am #1014614Jim
ParticipantThanks for your reply. The blog page is not a sub page, it also uses the main blog loop. The blog appears on that page as configured in “Dashboard> Settings > Reading > Front page displays > Posts page = <selected page>”. No code is required; no custom template is used.
This is standard WordPress functionality and uses the main query. This is confirmed for Genesis here. (The typical Genesis “blog template” is not used.)
October 14, 2015 at 1:38 pm #1014644Brian
MemberOh Ok Thanks.
That is simply enough.
I tested out on my Genesis Child theme.
The events correctly showed on the sub page and I was able to add the snippet and it reordered them as well. So it appears everything does work there.
Can you confirm the snippet is running on your site and active on that page?
If it is there could be a conflict somewhere else and running through our testing for conflicts guide could help narrow it down:
Let me know what you find out.
Thanks
October 14, 2015 at 6:09 pm #1014736Jim
ParticipantHi Brian,
> Can you confirm the snippet is running on your site and active on that page?er… Sorry! I had actually been required to turn it off to allow other people to test. It is now back and active.
I should also clarify the problem when the snippet is enabled: NO posts appear in the blog, instead “Sorry, no content matched your criteria.” is displayed without any post content of any type.
I disabled all plugins and found that the only active plugin required to recreate the problem is: The Events Calendar Pro 3.12.2. When I disable Pro, the snippet works as expected, mixing the event posts inline with blog posts in descending date order.
October 15, 2015 at 7:31 am #1014902Brian
MemberThanks for the info.
I narrowed down the issue here.
If this setting is checked:
Events > Settings > General Tab > “Recurring event instances”
And you add that snippet to reorder it breaks the main loop,
Unchecking that fixed the issue for me when using that snippet.
Let me know if that fixes it for you.
I am seeing about getting an updated snippet that works when that setting is checked.
Thanks
October 15, 2015 at 2:14 pm #1015092Jim
ParticipantHi Brian,
I see that this now allows the correct ordering in the blog loop.
However, this introduces another unacceptable problem of equal magnitude where *every* occurrence of *every* recurring event appears in the blog – and each with the same posting date.
Consider posting a weekly recurring seasonal event with a typical ~12 occurrences. This inserts 12 sequential posts into the blog, separating regular content by at least 2 *pages* of the *same* event with the *same* event date. It looks like event spam and drives away readers. For a site with multiples of recurring events it overwhelms the blog and makes the Pro plugin rather useless for recurring events.
So neither option is a solution. Really looking forward to finding a proper correction for this.
Thanks,
October 16, 2015 at 6:58 am #1015233Brian
MemberHi,
We are still looking into this. It is proving trickier to figure out then we thought.
I will update this ticket once I have more information.
Thanks
October 16, 2015 at 1:14 pm #1015411Brian
MemberHi,
So we came up with this snippet:
https://gist.github.com/barryhughes/60d1ad6cc849831b6fe0
Replace the other snippet with that one.
Then replace this:
$query->set( 'order', 'ASC' );with this:
$query->set( 'order', 'DESC' );We tested it and got it to work on one site. I tried it and it did not work the same for me, but we were unable to figure out why.
Please let us know if it works for you.
Thanks
-
AuthorPosts
- The topic ‘Order events in main blog loop by post date (fails after updates)’ is closed to new replies.
