• Resolved baldidiot

    (@baldidiot)


    Is it possible to exclude a specific category from the loop? I’ve tried using compare=not, eg:

    [loop type=post category=whatever compare=not]

    But it doesn’t seem to work.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try:

    [loop type=post taxonomy=category term=whatever compare=not]

    Thread Starter baldidiot

    (@baldidiot)

    Perfect, thanks!

    Please mark as solved

    Thread Starter baldidiot

    (@baldidiot)

    Actually I had a follow up question if you had any ideas. It works on it’s own but when combined with a field it seems to break, eg:

    [loop type=post field=myfield value=’myvalue’ taxonomy=category term=whatever compare=not]

    The loop works when using just one or the other but when combined the output isn’t right. I’m guessing it’s the compare=not? I tried adding _2 but neither worked:

    [loop type=post field=myfield value=’myvalue’ taxonomy_2=category term_2=whatever compare_2=not]

    [loop type=post taxonomy=category term=whatever compare=not field_2=myfield value_2=’myvalue’]

    Also tried defining the compare:

    [loop type=post taxonomy=category term=whatever compare=not field_2=myfield value_2=’myvalue’ compare_2=equal]

    Have you tried:
    [loop type=post field=myfield value=’myvalue’ and taxonomy=category term=whatever compare=not]

    • This reply was modified 4 years, 1 month ago by polarracing.
    Thread Starter baldidiot

    (@baldidiot)

    Thanks for the help, most appreciated. No luck with that though, unfortunately.

    For me this works. Needed to test with checkbox, but should not behave differently when used with field

    [loop type=instructor checkbox=mr_racing_show value='touring' and taxonomy=instructor_cat term=coach_cat-de compare=not]
    [field link]
    [/loop]
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Exclude Category From Loop’ is closed to new replies.