• petroglyphic

    (@petroglyphic)


    I have a loop: [loop type=profiles taxonomy=profile-type term=witw field=school_year value=2015-2016]. Gets all profiles whose profile-type is “witw” and whose school_year value is “2015-2016”. School_year is a custom field.
    I need a second loop which gets all profiles whose profile-type is “witw” except those whose school_year value is “2015-2016”. I’ve tried:
    [loop type=profiles taxonomy=profile-type term=witw relation=and taxonomy_2=school_year value_2=2015-2016 compare_2=not],
    [loop type=profiles taxonomy=profile-type term=witw compare=not field=school_year value=2015-2016],
    and every other combination I can think of. I either get all the “witw” posts or none of them. I’m guessing it’s something about the syntax with a taxonomy and a field value, because I have another loop (which you sent me several months ago) that does this with two taxonomies which works fine, but I can’t figure this one out.
    Thanks, Susan

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    I see, you found an overlap between taxonomy and field value compare parameters. Because of the combination, compare=not was being applied to both. This is actually a design flaw in the syntax.. To get around this issue, I added tax_compare and field_compare parameters, to differentiate the two queries.

    So, I think the following should work: [loop type=profiles taxonomy=profile-type term=witw field=school_year value=2015-2016 field_compare=not]

Viewing 1 replies (of 1 total)
  • The topic ‘loop exclude field value’ is closed to new replies.