Home › Forums › Calendar Products › Events Calendar PRO › Tag Cloud
- This topic has 13 replies, 4 voices, and was last updated 9 years, 6 months ago by
Joanna.
-
AuthorPosts
-
September 21, 2016 at 1:33 am #1166826
Joanna
ParticipantHi there,
I use tags with my events so that the tag cloud shows all relevant posts and events. The tag cloud displays everything correctly and there is no problem there. However, the events do not display in event date order, just in publication date order, which is pretty jumbled. Is there a way to change this please?
I have looked at the Filter Bar and understand that this would enable users to order events by tag, which would go some way to solving the problem. I expect I will need to buy this but that would still leave me with jumbled results in the tag cloud.
Thanks,
JoSeptember 21, 2016 at 2:52 pm #1167156Nico
MemberH there Jo,
Thanks for getting in touch with us! I’ll help you here…
However, the events do not display in event date order, just in publication date order, which is pretty jumbled. Is there a way to change this please?
Can you please clarify a bit on this? Are you referring to tag archive pages? If that’s the case do you have events and posts mixed together? What should be the ordering criteria if that is the case?
I have looked at the Filter Bar and understand that this would enable users to order events by tag, which would go some way to solving the problem. I expect I will need to buy this but that would still leave me with jumbled results in the tag cloud.
Yeap, this let’s you filter events by tags or event categories, but won’t affect other places than the main event views.
Please let me know about it,
Best,
NicoSeptember 22, 2016 at 12:35 am #1167271Joanna
ParticipantHi again,
Thanks for getting back to me.
I am not sure what a tag archive is I’m afraid. Is a tag archive the list that’s produced when you click on one of the words in a tag cloud and get a list of all posts with that tag? If so, then that is what I am talking about.
At the moment, the vast majority of my tag cloud words are either just for posts or just for events. I would be very happy with a solution that means having to separate posts and events. Obviously in an ideal world a solution that also allowed me to mix posts and events in one tag cloud word would be great too.
For my site, the ideal ordering for a list mixing posts and events would be with the events ordered by event date order (either with each instance of a recurring event being shown appropriately within that order or with just the first instance of a recurring event being shown appropriately within that order) and the posts all being listed before or after the events. I don’t mind what order the posts display in so long as the events are ordered by event date.
The ideal ordering for a list of just events would be by event date with recurring events being treated as above. At the moment it orders by the date I created the event.
I hope that makes sense ๐
Thanks again,
JoSeptember 23, 2016 at 3:44 pm #1168189Nico
MemberHey Jo,
Thanks for the follow-up!
I am not sure what a tag archive is Iโm afraid. Is a tag archive the list thatโs produced when you click on one of the words in a tag cloud and get a list of all posts with that tag? If so, then that is what I am talking about.
Yes, the tag archive is the page where all posts and events are shown by tag. For example this page โ http://toddledoddle.com/tag/arts-and-crafts/
Obviously in an ideal world a solution that also allowed me to mix posts and events in one tag cloud word would be great too.
Perfect, I’ll try to find a way to make it work for events, posts or events and posts. Give me some time to work on this, most probably I’ll get back to you on Monday with an update!
Thanks for the patience while I work on this,
Best,
NicoSeptember 24, 2016 at 1:56 am #1168234Joanna
ParticipantWow! Thanks Nico.
I’d really appreciate you taking the time to do that. Have a great weekend.
Jo
September 28, 2016 at 7:32 am #1169783Nico
MemberHi Jo,
Thanks for the patience while I worked on this ๐
Basically after various tries, I couldn’t find a way of ordering both posts and events by event start date. As posts don’t have that meta data (don’t have start date value), when I try to use this value they get excluded. From what I could search there’s no workaround for this ๐
What you can do is have tags exclusively for events and others just for posts. With this setup, tags for events will display event by start date (starting with the higher/newer start date and descending to the lower/oldest) and tags for posts will display as it does by default (by publish date).
I’m sorry but there’s seem to be no simple workaround for this! There might be more complex solutions like doing various queries (one for events and one for posts basically) and combining the results but exploring that would be out of the scope of the support forums.
Please let me know if using exclusive tags might work for you,
Best,
NicoSeptember 28, 2016 at 8:26 am #1169817Joanna
ParticipantHi Nico,
Thanks for trying, I really appreciate the effort.
I actually have a few tag archives that are just event tags (for example ‘Christmas’). I’ve had a look at the Christmas tag archive and the events are ordered in reverse event date order (the events happening later in the year are shown first and the events happening the earliest in the year are shown last). I think I can change the other categories to be exclusively event and post quite easily. I do have two questions about that method though please:
1. Is it possible to order an event only tag archive so that the events due to happen first/earliest in the year are shown first? Not sure if that’s clear but I mean that an event happening on 18 November 2016 would be shown in the list before an event happening on 1 December 2016. I’m guessing not but thought it was worth asking ๐
2. Is there a way to make each event in an event only tag archive automatically display the event date or event date range (if it’s a recurring event)? I think the event date needs showing so the order of the archive is clear but want to try to avoid going back through all my events!!
Thanks again,
JoSeptember 28, 2016 at 10:48 am #1169946Nico
MemberHey Jo,
Just an update, talking to Barry one of our devs he suggested the following code:
function mixed_tag_archive_ordering( WP_Query $query ) {
if ( ! $query->is_tag() || ! $query->is_main_query() || ! @$query->tribe_is_multi_posttype ) return;
add_filter( 'posts_orderby', 'mixed_tag_archive_order_sql' );
}function mixed_tag_archive_order_sql( $orderby_sql ) {
remove_filter( 'posts_orderby', 'mixed_tag_archive_order_sql' );
return ' post_type DESC, ' . $orderby_sql;
}add_action( 'tribe_events_pre_get_posts', 'mixed_tag_archive_ordering' );
This will show first events by start date and then posts, but with a big caveat doesn’t play well with PRO, or more specifically the show only the first instance of each recurring event setting. So if you decide to use this code be sure to test extensively before implementing it in the live site.
Best,
NicoSeptember 29, 2016 at 6:52 am #1170330Joanna
ParticipantHi Nico,
Thanks for this. I’m not sure I know enough about coding etc to try that yet so I will keep it handy and give it a go when I am feeling brave ๐ I just have a couple of questions left about the other method you suggested above (using exclusive tags) please:
1. Is it possible to order an event only tag archive so that the events due to happen first/earliest in the year are shown first? Not sure if thatโs clear but I mean that an event happening on 18 November 2016 would be shown in the list before an event happening on 1 December 2016. Iโm guessing not but thought it was worth asking ?
2. Is there a way to make each event in an event only tag archive automatically display the event date or event date range (if itโs a recurring event)? I think the event date needs showing so the order of the archive is clear but want to try to avoid going back through all my events!!
Thanks for your help,
JoSeptember 30, 2016 at 1:43 pm #1171228Nico
MemberThanks for following up Jo!
1. Is it possible to order an event only tag archive so that the events due to happen first/earliest in the year are shown first? Not sure if thatโs clear but I mean that an event happening on 18 November 2016 would be shown in the list before an event happening on 1 December 2016. Iโm guessing not but thought it was worth asking ?
The thing here is that all events are being shown past and future events, so the order can be from old to new or new to old. Unless we exclude past events and just show upcoming events, the most recent event first and the later after. Does this make sense?
2. Is there a way to make each event in an event only tag archive automatically display the event date or event date range (if itโs a recurring event)? I think the event date needs showing so the order of the archive is clear but want to try to avoid going back through all my events!!
Sure this is possible! You should look inside your theme folder for a file named tag.php or archive.php and edit how posts are printed to account for event date if it’s rendering an event. The amended code should look something like:
if( get_post_type() == 'tribe_events' ) {
echo '<div>'. tribe_get_start_date( get_the_ID(), false, 'M j, Y' ) .'</div>';
} else {
echo '<div>'. get_the_time('M j, Y') .'</div>';
}
If you are not sure about the above please send a copy of the theme (in a private reply) and I’ll inspect it and indicate where to place the snippet.Pleas let me know if that helps out!
Best,
NicoOctober 3, 2016 at 6:58 am #1171764Joanna
ParticipantThanks Nico – I guess it’s time to get more familiar with coding ๐ Leave it with me and I will get back to you later in the week with an update!
Jo
October 3, 2016 at 12:47 pm #1171921Nico
MemberPerfect Jo ๐ Good luck with it!
Best,
NicoOctober 25, 2016 at 9:35 am #1182554Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Tag Cloud’ is closed to new replies.
