Filtering Event posts into blog (2 questions)

Home Forums Calendar Products Events Calendar PRO Filtering Event posts into blog (2 questions)

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1014304
    Melissa
    Participant

    Hi, I have two questions. My events from Events Calendar are being fed into a blog post. It shows up with the last event first vs. the more recent events building up to the last event. Is there a way to reverse the way it is currently?

    On another forum (pre-sales), Geoff wrote:
    The post order is determined by the Published date instead of the Event date when it’s in the main blog loop. You can change the published date for each post so they display in a different order, or use a filter to do that. For example, here’s a filter than randomizes the events in the main blog loop. (https://gist.github.com/jesseeproductions/f7bdd1124e9c3fed5280)

    Geoff said to put it in functions.php file.

    Can you tell me the code to insert that relates to this specific issue above?

    (2) Is there a way to have the events tagged events go up into the blog post but not others?

    pre-sales support wrote:

    There is no way to create two calendars. However, each event category has it’s own distinct URL (e.g. [your-site]/events/category/[category-slug]) which allows you to link directly to different filtered variations of the calendar, which is like having multiple calendars on the site.

    To show some categories and not others in the blog feed, you could use another filter like the one before so that it excludes a specific category.

    Can you give more direction on what this filter code would say?

    Thank you.

    #1014313
    Rhonda
    Participant

    I am having the same issue. I am using tags to display events on my homepage but they are showing up with the most distant events first and the current events at the end. Please help!

    #1014611
    Melissa
    Participant

    Hi, is anyone here to answer these questions? Need help. thanks!

    #1014612
    Rhonda
    Participant

    I have the same question! “My events from Events Calendar are being fed into a blog post. It shows up with the last event first vs. the more recent events building up to the last event. Is there a way to reverse the way it is currently?”

    #1014658
    Brian
    Member

    Hi,

    Sorry for the delay here. I can help out.

    We have this snippet that will order the events by the publish date instead of the event date:

    Order Events by Post Date in the Main WordPress Post Query

    It gets enter at the bottom of your theme’s functions.php.

    That is the only snippet we have for reordering in the main blog.

    (2) Is there a way to have the events tagged events go up into the blog post but not others?

    As for only showing certain categories on the home page you can use this snippet to exclude categories from showing in the main blog by Event Category Slug:

    https://gist.github.com/jesseeproductions/eface479faf403c89784

    Again, it gets enter at the bottom of your theme’s functions.php.

    Let me know if you have any follow up questions.

    Thanks

    Hi Rhonda,

    Thanks for posting here. I can certainly help you here, but we can help you better if you create your own topic in the forum, where we can interact with you one on one. Also, we encourage you to post on your own topic because every time we post it will email the author of the topic. I think though that first solution might work for you so this could just be for future reference.

    Thanks

    #1014663
    Rhonda
    Participant

    Thank you. I created my own post on this subject a few days ago. I’m going to copy this and respond to it under my own post. Nico Santos was helping me.

    #1014694
    Brian
    Member

    Sounds good Rhonda.

    Melissa, let me know how the coding works out and we can go from here.

    Thanks

    #1014990
    Melissa
    Participant

    Hi Brian,

    Thanks so much. Part I was successful! Thank you. A side question to that – is there a way to add the event date so that it shows up in the heading of the blog post?

    Regarding Question 2, I want to exclude the category ’classes’. So do I substitute the word classes for events there? I assume yes so i will give it a try.

    Thank you!

    #1014998
    Melissa
    Participant

    Hi Brian,

    Something did not work with that (per my last post). Maybe I was not supposed to change events to classes or else more than in two places? Please let me know.

    Also, after an event happens, does it automatically get removed from showing up in the blog post?

    Thanks again.

    #1015137
    Brian
    Member

    Hi,

    I am not sure where you are referencing.

    If you want to exclude a category called classes you would replace this:

    'terms' => array( 'convention', 'meetup' ),

    with this

    'terms' => array( 'classes' ),

    Does that work then?

    Also, after an event happens, does it automatically get removed from showing up in the blog post?

    Not unless you delete the event otherwise it will show, but it should be farther down the list so it is not seen on the home page.

    #1015305
    Melissa
    Participant

    Hi, thanks Brian. So, yes, that worked. I had it wrong before.

    So, I went back to add dates to all the events in the heading so they show up in the blog post and, not sure if it was that way before, they are all in a miscellaneous order, not in descending, not in ascending order, just all over.

    Can you think of a reason that would happen and how to fix it?

    Thank you!

    #1015409
    Brian
    Member

    Hi,

    I visited your site and see what you mean.

    The snippet you added is to order by the publish date of the event and posts so it appears to be correct.

    That snippet does not take into account event dates so the order can be random like that. It is suppose to show likes posts with the most recent post or event published to show first.

    Does that make sense?

    #1015962
    Melissa
    Participant

    Hi, so if I publish the events with the newest first, it will go in order? Is that right? Which way do I need to publish the events for it to work so that the more recent events come first viewed in the posts?

    Actually, that will not entirely help because in the future events will be posted not always in order. Is there any way for it to read it by date?

    Thanks.

    • This reply was modified 10 years, 6 months ago by Melissa.
    • This reply was modified 10 years, 6 months ago by Melissa.
    #1016001
    Brian
    Member

    Hi,

    You are trying to force two different ordering systems together and that is creating the issue.

    Posts are ordered by publish date with the most recent first.

    Events are ordered by start date with the next upcoming listed first.

    In WordPress the only common ground is the publish date and that can then show the events out of order.

    There is no way to order the events by start date and then fit in posts neither system was ever designed for that.

    If you are looking to show upcoming events it is better to keep them separate and use the Event List Widget or Shortcode and show events in there.

    I do not have anything else for this, but what has been provided and it could be maybe possible to do with a custom loop, but that is beyond the support I can provide.

    #1016355
    Melissa
    Participant

    Okay, thank you. A note: If the blog default for events is the furthest away event showing up first, basically in descending order, that there should be a way to reverse that it would seem to me. I dont know many people who would order the events this way in a blog post – with the event furthest away coming up first. I am trying to think of someone that might be useful for and cannot. 🙂

    I hope you will consider offering this or figuring out a way. It seems like something your customers would really want and can use.

    Thanks for all your help, Brian.

    • This reply was modified 10 years, 6 months ago by Melissa.
Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Filtering Event posts into blog (2 questions)’ is closed to new replies.