How to exclude categories from the advanced list widget?

Home Forums Calendar Products Events Calendar PRO How to exclude categories from the advanced list widget?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #13254
    Greg
    Participant

    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?

    #13255
    Greg
    Participant

    Here is the if/else statement that I tried using (without the “php” tags so it will display here):


    #13256
    Greg
    Participant

    Sorry, it’s not letting me put the code in. Here it is on pastebin:
    http://pastebin.com/e5qidUMq

    #13266
    Rob
    Member

    Thanks 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.

    #13286
    Jonah
    Participant

    Hi Greg, can you please also post the pa_in_taxonomy() function so I can see what you’ve got for that?

    #13293
    Greg
    Participant

    Do you mean this: http://pastebin.com/e5qidUMq ?



    #13295
    Greg
    Participant

    It’s essentially “if (pa_in_taxonomy(‘tribe_events_cat’, ‘Vacation’))”.

    #13296
    Jonah
    Participant

    No, 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?

    #13299
    Greg
    Participant

    To 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.

    #13302
    Greg
    Participant
    #13303
    Greg
    Participant

    And, I have it in my functions.php file for my theme. Sorry, I was having difficulty locating it.

    #13347
    Jonah
    Participant

    Gotcha, ok thanks. Which file are you editing for the advanced upcoming events sidebar widget?

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘How to exclude categories from the advanced list widget?’ is closed to new replies.