Events in main blog loop reversed

Home Forums Calendar Products Events Calendar PRO Events in main blog loop reversed

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #1196737
    James Rosnack
    Participant

    This seems to be an ongoing issue that a few folks have mentioned but no real resolution. Ive even talked to Geoff about it in the free WP forums but his link to a fix doesnt work.

    The DEV Site is here:
    http://naidevsite1.us/

    The problem is, the WP loop displays based on the date the post is created. Makes sense for your basic blog feeds. The issue at hand is that it displays the events listings by date created as well and I need them to display by event date, but still be mixed in with the latest news (posts) feed.

    Here is a Modern Tribe support forum post on the issue that includes some code to add to the functions.php
    https://wordpress.org/support/topic/events-in-main-blog-loop-reversed/#post-8457888

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

    This code is wrong somehow. When I used it with a ‘orderby’ => ‘start_date’, I got the error:
    Parse error: syntax error, unexpected ‘=>’ (T_DOUBLE_ARROW) in /home/naidev01/public_html/wp-content/themes/wp_bullet-child/functions.php on line 15

    My discussions with another program brought up additional (possible) issues:
    “I think that Github code might be a good start but there is more missing than a simple orderby, and it’s not a matter of a syntax error only. If I’m correct, meta query should be constructed here, and without making some tests we can’t be sure how it’s going to mix with regular posts.”

    Im confused as to why this isnt a bigger issue for folks? How can we overcome the problem of the events not ordered by start date in the main loop?

    #1197290
    Andras
    Keymaster

    Hi neuroticartist,

    Thanks for reaching out with your question.

    I tested including events in the main blog loop and for me it shows as you would like it to. Events are injected in the blog loop and they are sorted based on the time of the event, and not based on the date of publishing.

    Could you please share with me your system information (https://theeventscalendar.com/knowledgebase/sharing-sys-info/ ) and run a test for conflicts, also removing all custom code from your functions.php file and check if the issue still exists?

    I’ll be waiting for the results?

    Cheers,
    Andras

    PS: Are you really neurotic or that’s just a nickname? 😉

    #1198503
    James Rosnack
    Participant

    This reply is private.

    #1198507
    James Rosnack
    Participant

    This reply is private.

    #1199088
    Andras
    Keymaster

    Hey successfulartists, (sorry, I rather would like to call you something a bit more positive. Hope you don’t mind.)

    Thanks for sharing that. I’m super happy to see that your calendar plugins are all updated. A rare view and saves time. Great job on that!

    I think we need some clarification to be able to properly solve this issue.

    I need them to display by event date, but still be mixed in with the latest news (posts) feed.

    So, how it currently works is:

    • the blog displays the posts in descending order, so the newest post is always on top
    • the events can be injected into this loop
    • the events will be injected by event date and time
    • since the blog posts are in descending order, the events will be in descending order as well

    So if you want to show both the blog posts and the events, there are couple of questions here.

    As a start: if you want the events to show up timely (oldest first), then your blog posts would also show up like that. Meaning that on the top of your page you will see some very old post, unless somehow you set up a limit. (Like oldest post shown should be 1 week old max.)

    So my question is to you: how do you want the mix of blog posts and events to show up? In what order? For the events what should be taken into account, the event date (now default) or publish date?

    Looking forward to your feedback.

    Cheers,
    Andras

     

    #1199102
    James Rosnack
    Participant

    Perhaps I am putting too much info into my request. Currently, my problem is that the events are showing up in a backward chronological order. Furthest date from today at the top, closest date to today at the far end of the loop.

    #1199200
    James Rosnack
    Participant

    I originally thought it was showing them by creation date, as with the blog posts, but on further testing it just looks like its displaying events reversed from what I need.

    #1199674
    Andras
    Keymaster

    So, if you want to show the events by event start date and ‘oldest first’, then try this snippet:

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

    This will also re-order your blogposts.

    Does this do the trick?

    Andras

    #1199725
    James Rosnack
    Participant

    no this isnt the same problem as my issue, I dont want everything reversed, I want the blog posts to show as they normally do, by creation date, and I want the events that are added to show up in the loop with the event closest to the day the viewer is looking at them first and they get further away as you scroll thru the pages.

    So if I am on the home page, and today is November 30th, the news feed will show as such:

    Blog from yesterday Nov. 29th
    NEXT EVENT DEC 2ND
    NEXT EVENT DECEMBER 8TH
    blog from last week
    NEXT EVENT DECEMBER 15TH
    etc…

    Im still confused as to why this isn’t default, and why anyone would want it displayed differently… or is that how it is supposed to show and mine is the one needing fixed somehow?

    #1200275
    Andras
    Keymaster

    Okay, now I understand.

    I’m afraid that is a tad bit difficult as the blog posts are decreasing in time, events are increasing. You get what I mean.

    The only way of doing what you’d like would be that you inject the events there based on publication time and you manually set the publication time of the events to the needed date, so they show up at the right place.

    For the above example:

    Blog from yesterday Nov. 29th
    NEXT EVENT DEC 2ND – publication time nov 28
    NEXT EVENT DECEMBER 8TH – publication time nov 27
    blog from last week (i.e. nov 22)
    NEXT EVENT DECEMBER 15TH – publication time nov 21

    Whaddaya think of this?

    A.

    #1200286
    James Rosnack
    Participant

    Manually setting each event isn’t at all a reasonable answer unfortunately, especially if I hand this site off to my clients and try to explain to them how to manage that each time they create an event.

    So I am still so utterly confused why this is an issue. When you design the option to put the events into the blog loop, how can it not be common sense that they should appear in the feed with the next event shown first? Who and for what reason would anyone want to put the event listings into their home page loop showing the last event sometime next year in between today’s blog posts? It just doesn’t make any sense to me at all that this was how it was made and that everyone at Modern Tribe considered this to be perfectly fine… and that no one at all said “don’t you think that they should be shown the other way around?”. It leaves me really really confused about why you even added the option in the first place

    So you are telling me there is no other options and that Modern Tribe has no interest or intention on fixing or changing this?

    • This reply was modified 7 years, 4 months ago by James Rosnack.
    #1200815
    James Rosnack
    Participant

    Hello?

    #1201191
    Andras
    Keymaster

    Hello Artist,

    Sorry for the somewhat belated reply. I was knocked out by a flu yesterday and am in recovery.

    I understand that in some cases setting the event publish dates manually is not an option.

    And I’m getting a bit confused now here. I don’t quite understand what the problem is and what is the end result that you would like to achieve.

    You mentioned this before:

    Blog from yesterday Nov. 29th
    NEXT EVENT DEC 2ND
    NEXT EVENT DECEMBER 8TH
    blog from last week
    NEXT EVENT DECEMBER 15TH
    etc…

    which can be achieved with the solution I proposed; simply because blog posts are ordered one way (newest / freshest to oldest, or rather from present to past) and Events are ordered the other way (oldest to freshest or rather from present to future). This can be overruled if you order the events by their publish date. If you still want to inject the Events by event date and get the same order above, I have to disappoint you, as that is not possible. Even if we wanted to do it, we couldn’t. Thus, this is not a bug, it is an impossibility.

     

    Who and for what reason would anyone want to put the event listings into their home page loop showing the last event sometime next year in between today’s blog posts?

    I’m not the one to say who is, but I can easily imagine that from our 4 million downloads and couple hundred thousand active users, there are some who might be using it. And if it is not suiting their needs, then they wither tweak it, or turn to us for help and we show them the way. For this to happen, we need to have a clear understanding of what the user wants to achieve, and if the outcome is possible, then we are happy to help out, or at least give directions.

     

    It just doesn’t make any sense to me at all…

    You are not alone in this. There are pieces of art, which don’t make any sense to me at all either. 😉

     

    and that no one at all said “don’t you think that they should be shown the other way around?”

    As said above, if the feature didn’t fully meet the need of the user, and they turned to us for help with a <span style=”text-decoration: underline;”>clear end result</span> in mind, then we were – and still are – happy to provide help to achieve the goal. If it is doable.

     

    It leaves me really really confused about why you even added the option in the first place

    I’m sorry about the confusion here. The option was added, because there are users who want to show their events in their blog loop. Past or future, depending on need. But, as with all settings, it can be switched off. Nobody is obliged to use it. That’s the beauty of it.

     

    So you are telling me there is no other options and that Modern Tribe has no interest or intention on fixing or changing this?

    There are lots of options with customization. Some of them are easy some not. If you let me know what is the end result you would like to see when injecting events into your blog loop, then I might be able to help you out and guide you in the right direction. Since we are limited in supporting customization I might not be able to give you a ready-to-install solution, but I can definitely give you guidance. (For info, our support policy.)

    As of the moment, this is not a bug; it is a feature that works the way the developers intended it to work and it can be customized in many ways. So there is nothing to be fixes. Nor do we intend to change this functionality at the moment.

    If you would like to propose a change or a new feature then please visit our User Voice Page and make a new suggestion there.

    I would be happy to help you achieve your goal, let me know how I can help you further.

    Cheers,
    Andras

    #1201199
    James Rosnack
    Participant

    This is just getting aggravatingly stupid now. I am designing the site and I am passing it over to a client. I am NOT able to manually reset each and every event that is created because 1. there is a LOT of events and 2. I am not managing the site once its done. 3. a client not familiar with the problem will look at me like an idiot if I tried to explain that to them.

    Also, you may have a LOT of users but clearly there are a TON of people asking this very question all over the web, many without answer and others who tell you to flip everything which doesn’t work. There is no normal reason where people want to inject the events into the main loop and see the very last event first, it’s ridiculous to imply there are thousands of people who probably enjoy it that way.

    There are 3 people on the free version WP thread alone that dont understand your comments. There is also several threads in this forum asking the same thing with no responses. Its like you guys just dont care about this issue and ignore it. Seeing that you couldnt even grasp what I was saying till I spelled it out for you means you guys dont even understand the basics of why events would go in the main loop to begin with.

    to me, this problem is common sense, to you, it seems like a silly, opinionated wish list type thing. If you are going to offer an option to inject events into the loop IT SHOULD WORK LIKE THE LOOP!!!! It *IS* a bug, or its stupid programming with little thought. If you can’t add events to the main loop to display with the next coming event showing up on the homepage, then why would you even add the option? Its like putting a car door where the is no seat, and you asking me, but why not just sit on the floor of the car? cant your client just put a folding chair in there everytime they want to go for a ride?

    I guess we are at an impasse and your humor isn’t funny any longer. Im sick of going circles on this. I’ll close this thread, explain to everyone else you don’t really give a shit and request a refund and use the free version or find something else.

    #1201800
    Geoff
    Member

    Hi @neuroticartist,

    I had worked you with this on the thread you posted to WordPress.org and thought I’d jump in here as well. It’s clear that both threads have gotten quite off track, so I’d like to attempt to steer things back in a more productive direction.

    Let’s get back to the original request. You are looking for a way to:

    • Include events in the main blog loop
    • Order those events by the Event Start Date in ascending order

    We’ve already established that the main blog loop ignores the Event Start Date because it is designed to order all posts (regardless of what post type it includes) but Publish Date.

    I had provided you with an example snippet that not only adds Event posts to the main blog loop, but orders all posts by Date Modified. That is not exactly what you were looking for, but was meant to be an example of what is possible.

    Here is a more productive version of that snippet:

    https://gist.github.com/geoffgraham/1435e01e9f2861f7a4a432c367e3d043

    This will do the following:

    • Add Events to the main blog loop on a homepage
    • Order all posts by Date Published in Descending order

    I hope this will be a more workable solution for you, or at least give you the blueprint for what you’re looking to do. If what I’ve articulated here does not match up with you requirements, please let us know and we’d, of course, be happy to look at it again with fresh eyes.

    Thanks,
    Geoff

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