Support » Plugin: The Events Calendar » events in main blog loop reversed

  • Resolved neuroticartist

    (@neuroticartist)


    Ive searched the Modern Tribe forums and found several other people that have posted about having a problem with the events calendar displaying events in main blog loop backwards, meaning the furthest event is showing first and the most recent event is several pages in, which is the reverse of how it should be, it should be showing the most recent event on page 1.

    Some of those posts were told to post here because it wasn’t the pro version, others were told that customization is needed? I don’t understand and have yet to find a clear answer. This situation happens regardless of theme or if I deactivate other plugins.

    Am I going to have to upgrade to the Pro to get support on this? Ive already got the pro of the event tickets and other pro events calendars on other sites, Id like to not have to upgrade just yet to fix the problem if at all possible!

    http://naidevsite1.us/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor geoffgraham

    (@geoffgraham)

    Hey there!

    You definitely do not need to upgrade to PRO for this. It’s actually because the blog loop is designed to display posts by the publish date instead of the event date.

    Here’s an example of how you can target the event posts in the main blog feed and change the order based on other variables:

    https://gist.github.com/geoffgraham/b3e17ea1bb2a6464b119

    That specific example changes events to display by order of date modified, but you could apply it to event start date as well.

    Cheers!
    Geoff

    Thread Starter neuroticartist

    (@neuroticartist)

    thanks I’ll give this a try, the way you explained it simply makes sense. Others had said “Its just design that way” which left me frustrated.

    So if “modified” changes the order to date modified, what would order by event date be?

    May I jump on this…
    First, I think this is clearly a bug, isn’t it? The Modern Tribe website says that events would by default be sorted by event date. While they aren’t. Well, not “into the future” but backwards, which doesn’t make any sense at all. A bug.
    Or am I missing something?
    Secondly, where am I supposed to put this code from GitHub? Into functions.php? If so, does it matter where?

    Thread Starter neuroticartist

    (@neuroticartist)

    you can add it anywhere in functions, it doesnt matter, I usually add it at the bottom with a little note so I know what its for. Geoff, I still had trouble with this figuring out what the variable of order by start date is, I cant find that info anywhere.

    Yeah, I’d like to know that as well. Please!

    Thread Starter neuroticartist

    (@neuroticartist)

    I tried using the github code posted in the link above and it gave me an error in the site once I uploaded it

    Parse error: syntax error, unexpected ‘=>’ (T_DOUBLE_ARROW) in /home/naidev01/public_html/wp-content/themes/wp_bullet-child/functions.php on line 15

    I need to bring this up again. @geoffgraham, can you please explain which variable sets the ordering of the events in the main blog loop to be ascending (from today until the furthest event in the future)? I really need to get this sorted. By default my events display the other way round (I haven’t changed anything in the functions.php file or elsewhere in the code).

    Plugin Author András Guseo

    (@aguseo)

    Hello both,

    That snippet has developed a sickness. 🙂 I’ll get Geoff to revisit that.

    Until then, if you only want to change the order of how events are shown in the main blog loop, then try this:

    https://gist.github.com/andrasguseo/f4c078f8239ce44a8be82abd51ea1aec

    Cheers,
    Andras

    thanks @aguseo, but that turns around all blog posts. The issue I am struggling with is different: the regular blog posts are listed in the correct oder: the newest entry is listed first and further down the page are older posts. But when adding the events to the blog roll I would like to have the next upcoming event listed on top. I see that there is no easy logic behind that, one would have to determine when an event with a date further in the future should start to appear.
    Uhm, the more I think about it the less it seems feasible. Maybe I will leave the events out of the blog roll – because I don’t want an event in 2018 to be on top of my blog roll, as it is now…
    If you have further suggestions how to solve that I’d be really thankful!

    • This reply was modified 4 years, 4 months ago by frieauffcom.
    Plugin Author András Guseo

    (@aguseo)

    Yah man, sorry. Corrected the code now. Thx for pointing that out.

    And yeah, the logic you say should work. Get the next event after NOW() and put that on top, but nothing else.

    Maybe you could create a custom template with the blog loop, and then simply add some code on top of it which just simply reads the next event from the database. That would be a nice workaround methinks, and then you don’t need to mix-and-match the blogloop with the events.

    A.

    Thread Starter neuroticartist

    (@neuroticartist)

    Why is this so confusing to everyone at Modern Tribe? You would think it would act this way by default. This code reverses everything, including blog posts.

    Thread Starter neuroticartist

    (@neuroticartist)

    frieauffcom, @aguseo is telling me on the Moderm Tribe forums that this works the way it is supposed to, it isnt a bug and the fact that we want events to show up in order of the next event without screwing up our blog feed order it some random wish list thing that the programmers never considered.

    To me its a bug, or its lazy programming, to him, its our problem and wont be addressed.

    Plugin Contributor geoffgraham

    (@geoffgraham)

    Hey folks, jumping back in here because this topic clearly got off track.

    First off, @neuroticartist, you have also posted a topic for this question in our premium forums. I have responded to you there with an updated snippet to consider:

    https://theeventscalendar.com/support/forums/topic/events-in-main-blog-loop-reversed/#dl_post-1201800

    Secondly, I do want to confirm that this is not a bug, but rather a customization. We had established that the feature to add Event posts to the main blog loop is a setting on the Events > Settings > General screen and that the setting is working as expected. In other words, it adds Events anywhere the main blog loop is in effect.

    By default, the main blog loop displays posts by the Publish Date and does so in Descending order. That does not come from The Events Calendar, but is a WordPress default, regardless of the post type being called by the query.

    What is being requested here is a customization of that behavior. While both Andras and I have attempted to provide examples for how that can be overridden using a filter, I think the frustration has been more our inability to provide you with a solid customization than it is the plugin’s quality or our willingness to help. For that, I’m truly sorry.

    At the same time, I want to add a reminder that support does not cover customizations, but rather troubleshooting for issues with installation or with the way the plugin is intended to work. We also have a feature request forum if you come across anything like this) that you would like us to consider for a future release.

    Again, I’m sorry if we did not properly set expectations up front, but I am hoping that this reply, in addition to the reply I offered @neuroticartist on our premium forums will help drive this conversation to a much more productive place.

    Cheers and sincerely,
    Geoff

    Hi there,

    Looks like it’s been a few weeks or more since we’ve seen activity on this thread! I’m going to go ahead and mark this resolved, but should you still need assistance, please don’t hesitate to open a new thread!

    You may also find the following documentation helpful to search in the future:

    TEC Knowledgebase
    TEC Technical Documentation

    Cheers,

    Shelby 🙂

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘events in main blog loop reversed’ is closed to new replies.