Home › Forums › Calendar Products › Events Calendar PRO › Filtering Event posts into blog (2 questions)
- This topic has 15 replies, 3 voices, and was last updated 10 years, 6 months ago by
Brian.
-
AuthorPosts
-
October 13, 2015 at 3:12 pm #1014304
Melissa
ParticipantHi, 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.
October 13, 2015 at 3:38 pm #1014313Rhonda
ParticipantI 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!
October 14, 2015 at 11:09 am #1014611Melissa
ParticipantHi, is anyone here to answer these questions? Need help. thanks!
October 14, 2015 at 11:11 am #1014612Rhonda
ParticipantI 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?”
October 14, 2015 at 1:57 pm #1014658Brian
MemberHi,
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:
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
October 14, 2015 at 2:06 pm #1014663Rhonda
ParticipantThank 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.
October 14, 2015 at 4:07 pm #1014694Brian
MemberSounds good Rhonda.
Melissa, let me know how the coding works out and we can go from here.
Thanks
October 15, 2015 at 9:49 am #1014990Melissa
ParticipantHi 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!
October 15, 2015 at 9:59 am #1014998Melissa
ParticipantHi 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.
October 15, 2015 at 5:03 pm #1015137Brian
MemberHi,
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.
October 16, 2015 at 8:13 am #1015305Melissa
ParticipantHi, 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!
October 16, 2015 at 1:12 pm #1015409Brian
MemberHi,
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?
October 19, 2015 at 1:29 pm #1015962Melissa
ParticipantHi, 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.
October 19, 2015 at 3:30 pm #1016001Brian
MemberHi,
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.
October 20, 2015 at 12:33 pm #1016355Melissa
ParticipantOkay, 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.
-
This reply was modified 10 years, 6 months ago by
-
AuthorPosts
- The topic ‘Filtering Event posts into blog (2 questions)’ is closed to new replies.
