Home › Forums › Calendar Products › Events Calendar PRO › Shortcode sort by tag AND category
- This topic has 5 replies, 2 voices, and was last updated 8 years, 7 months ago by Brook.
-
AuthorPosts
-
October 14, 2015 at 12:06 pm #1014628Our Saviors ChurchParticipant
when using the [tribe_events_list] shortcode with the category and tag filters, the results are events from either the category or the tag. How can the events listed be from the category AND the tag? I need only the events that are in a certain category and that have a certain tag. and, not or. Does that make sense?
October 14, 2015 at 7:47 pm #1014745BrookParticipantHowdy Tyler,
That’s a good question, I did not realize this myself until 2 seconds ago when I investigated. Buried in our code there is actually a shortcode argument called “operand”. If you wish to do AND instead of the default OR, specify it like so:
[tribe_events_list operand="AND"]
Does that do the trick?
Cheers!
– Brook
October 14, 2015 at 8:24 pm #1014753Our Saviors ChurchParticipantHey Brook, it appears that it’s still pulling events with either the category or the tag, not from events from the category and the tag. Here’s my shortcode:
[tribe_events_list tags="growth-track" category="opelousas" operand="AND"]
October 16, 2015 at 8:05 am #1015301BrookParticipantMy mistake, Tyler. I should have tested that first. There is one missing element to getting this to work. Inside of this file /events-calendar-pro/src/Tribe/Shortcodes/Events_List.php on line 48 there is a variable called $default_args. It needs the following line added to it:
'operand' => 'AND',
In my tests that added the operand to the shortcode, and should make your above shortcode work. It working for you as well?
– Brook
October 18, 2015 at 10:39 am #1015673Our Saviors ChurchParticipantBeautiful! Thanks!
October 19, 2015 at 9:16 am #1015872BrookParticipantExcellent. I am going to log this as a feature request. It will likely be included in our 4.1 release as the next 4.0 release is already in testing and can’t have more features added to it. Until it is included as a feature in the plugin, each time you update this change will be undone. Until then you will need to either readd that line, or ignore the update.
I will set this thread to be notified when the feature is ready to be released. Please let me know if you have any questions. Cheers!
- Brook
-
AuthorPosts
- The topic ‘Shortcode sort by tag AND category’ is closed to new replies.