Home › Forums › Calendar Products › Events Calendar PRO › How to exclude categories from the advanced list widget?
- This topic has 11 replies, 3 voices, and was last updated 12 years, 4 months ago by Jonah.
-
AuthorPosts
-
January 12, 2012 at 6:40 am #13254GregParticipant
The advanced upcoming events sidebar widget allows for selecting an individual category or “all events” (if you want to show all categories). My client has a “vacation” category that they don’t want shown on the sidebar widget. I tried adding in a simple if/else statement to the widget file (events-advanced-list-load-widget-display.php) but it only sort of works.
Yes, it does not show any event from the vacation category but it still counts those hidden events in the number of events to “show” in the widget (ie. I have it set to show 4 events and if there is 1 vacation entry I am left with only 3 events showing… it’s still counting the one vacation entry). Any ideas?
January 12, 2012 at 6:42 am #13255GregParticipantHere is the if/else statement that I tried using (without the “php” tags so it will display here):
January 12, 2012 at 6:45 am #13256GregParticipantSorry, it’s not letting me put the code in. Here it is on pastebin:
http://pastebin.com/e5qidUMqJanuary 12, 2012 at 9:38 am #13266RobMemberThanks for sharing, Greg. Sorry about the code issue…you should be able to drop it in correctly with the < code > tag. That’d look like this:
My sample code.
The point you’ve raised here is a good one. Though outside my area of expertise, I’ve asked Jonah to chime in today.January 12, 2012 at 12:21 pm #13286JonahParticipantHi Greg, can you please also post the pa_in_taxonomy() function so I can see what you’ve got for that?
January 12, 2012 at 12:36 pm #13293GregParticipantJanuary 12, 2012 at 12:37 pm #13295GregParticipantIt’s essentially “if (pa_in_taxonomy(‘tribe_events_cat’, ‘Vacation’))”.
January 12, 2012 at 12:39 pm #13296JonahParticipantNo, it looks like you’ve got a custom function in the above code ‘pa_in_taxonomy()’ – where is this from and what does it do?
January 12, 2012 at 12:52 pm #13299GregParticipantTo be honest, I can’t find that function anywhere in my code. I thought that I got that from you in a post on this forum in regards to looking up categories. The categories are all in taxonomies and I swear that all I did was try the code that you had shown someone else here.
January 12, 2012 at 1:02 pm #13302GregParticipantAh, ok. I got it from here: http://alex.leonard.ie/2011/06/30/wordpress-check-if-post-is-in-custom-taxonomy/
January 12, 2012 at 1:08 pm #13303GregParticipantAnd, I have it in my functions.php file for my theme. Sorry, I was having difficulty locating it.
January 13, 2012 at 12:34 pm #13347JonahParticipantGotcha, ok thanks. Which file are you editing for the advanced upcoming events sidebar widget?
-
AuthorPosts
- The topic ‘How to exclude categories from the advanced list widget?’ is closed to new replies.