Home › Forums › Calendar Products › Events Calendar PRO › Hiding Passed Events on Tag Page.
- This topic has 3 replies, 2 voices, and was last updated 11 years, 8 months ago by
Brook.
-
AuthorPosts
-
August 21, 2014 at 8:45 pm #690541
dealerdan
ParticipantHey guys,
I think I read somewhere that it was by design that tag pages were in descending order, but I have a lot of events planned well in advance so I’d much prefer them to be in ascending order. I was able to do that by changing the query to the following code:
<?php $posts=query_posts($query_string . ‘&order=asc’);
if ( have_posts() ) : ?>It works as I hoped – except that any events that have already passed are showing up there, and showing up first which obviously is no good 🙂 You can see an example at: http://www.kingstonontarioevents.com/tag/movies-in-the-square/
I was looking around single-venue.php as the functionality is used there, and also came across these links:
https://gist.github.com/jo-snips/3542941
http://pastebin.com/uHCEjEiBThat were shared on the forum before, and tried a few different things but had no luck.
Wondering if you guys had any ideas or suggestions – if not no worries, as I know it can be a lot to ask 🙂
August 22, 2014 at 1:41 pm #692237Brook
ParticipantHowdy dealerdan,
That is a great question. It is possible. The meta field ‘_EventStartDate’ and ‘_EventEndDate’ can be used to filter out events based on their start and or end times. Since you are already modifying that query, try adding some parameters that would filter out events based on their start or end times (use the end date if you want currently ongoing events to be included on the page). Keep in mind though that the purpose of the tag page is partially for search engines. By removing archived items from an archive page like tags, you could be causing your site harm in unexpected ways. But, if that is your wish, the above is how I’d do it.
Hopefully that makes sense. If I can answer some more high level stuff regarding this please let me know. Cheers!
– Brook
August 22, 2014 at 7:03 pm #692757dealerdan
ParticipantThanks Brook – appreciate the help. Hopefully will be good to go from that. Cheers.
August 25, 2014 at 11:41 pm #700357Brook
ParticipantExcellent! Please feel free to open a new topic should you ever have more API questions. I am going to archive this one since it is resolved. Cheers!
– Brook
-
AuthorPosts
- The topic ‘Hiding Passed Events on Tag Page.’ is closed to new replies.
