• Resolved shaunbowen

    (@shaunbowen)


    Hi there, when using the ‘Posts Grid’ widget, I can successfully exclude a single category using an additional query like:

    category__not_in=9

    However, I can’t figure out the syntax for excluding multiple categories. The WordPress ‘Query Posts’ info doesn’t really help with this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author livemesh

    (@livemesh)

    You can to ask this question in SiteOrigin forum. May be they parse the arguments into an array if you provided comma separated values since the parameter expects an array if you want to exclude multiple categories. Pls check with them once since we just use their standard query controls provided by SiteOrigin to accomplish this.

    Pls let me know if no such option exists. I will try to provide a solution which filters the query programmatically in your child theme.

    Thread Starter shaunbowen

    (@shaunbowen)

    I have actually managed to figure it out based on some deep Google searching! The syntax should actually be:

    cat=-9,-179,-180,-181,-182,-183,-184

    I will mark this as resolved and then perhaps it could be added in the plugin widget, under the relevant box (to help future users).

    As a side note, the query does not exclude the categories from showing in the filter section (if used). To get around this, I used this in my CSS:

    a[data-value=".term-9"],
    a[data-value=".term-179"],
    a[data-value=".term-180"],
    a[data-value=".term-181"],
    a[data-value=".term-182"],
    a[data-value=".term-183"],
    a[data-value=".term-184"] {
    	display: none !important;
    }
    • This reply was modified 1 year, 3 months ago by shaunbowen.
    Plugin Author livemesh

    (@livemesh)

    Was not aware of this. This should help everyone who is looking to solve this. Thanks for the posting.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Posts Grid – Exclude Multiple Categories’ is closed to new replies.