This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Mini Post Widget – Exclude Category

  • Creator
    Topic
  • #21946
    davidjohnson101
    Participant

    How can I exclude a post category?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #21948
    Jason Bobich
    Keymaster

    Hello David,

    You can use the “Custom Query” option of the widget to write out any WP query string, you like.

    cat=-12

    12 would be the numeric ID of the category you want to exclude in this example.

    Reference: https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters

    #21952
    davidjohnson101
    Participant

    Ah, that makes absolute sense. Thank you.

    #21953
    davidjohnson101
    Participant

    I’m using:

    cat=-19

    I have the settings to show all categories but I only want that one category not to show. Is that the exact string that I’m supposed to use? Because it didn’t do what it was supposed to do. I’m still seeing that category in the mini post list widget.

    #21954
    davidjohnson101
    Participant

    More info. After saving the widget and then refreshing the widget page, I am noticing that the query string has disappeared. It looks like it’s not saving when I click the save button.

    #21956
    davidjohnson101
    Participant

    Strange. I just tried it again and it took this time.

Viewing 5 replies - 1 through 5 (of 5 total)

The forum ‘Swagger Responsive WordPress Theme’ is closed to new topics and replies.