• Hi,
    tanks for the plugin, it is great!

    How can I exclude a post in a loop that contains a certain tag?
    I’d like to show a specifice search results block, then some general posts from the same category.

    Foods contain apple and orange.
    1:
    [loop category=”fruits” tag=”apple” tag=”orange” count=5]
    [field title-link]
    [/loop]

    2:
    Foods contain apple, but don’t orange
    [loop category=”fruits” tag=”apple” – how can exclude posts with tag: orange? – count=5]
    [field title-link]
    [/loop]

    Result1:
    Orange and apple pie 1 …
    Orange and apple pie 2 …

    Result2:
    Orange and apple pie 1 …
    Orange and apple pie 2 …
    Apple pie with grape …
    Apple pie with lemon …

    The problem is, there are duplicated results. How could be the Result2 only:
    Apple pie with grape …
    Apple pie with lemon …

    I’d like to list some posts that contain
    apple and several other fruits (I can’t add all tags to filter!), but don’t contain orange.

    Thanks
    Richie

Viewing 5 replies - 1 through 5 (of 5 total)
  • [loop] for all tags you like to have and use [if] for your results

    Thread Starter richardtoth

    (@richardtoth)

    Thanks, I’m trying it 😉
    r.

    Thread Starter richardtoth

    (@richardtoth)

    I’ve tried using [if], read the docs, but I’m not a coder. I’ve spent some time with it, with no luck. Please give me an example how to implement with [if] the above mentioned task.
    Thanks
    r

    Not working with tags – but out of my head:

    [loop *** category=”fruits” tag=”apple,orange” count=5]  *** = I guess you are missing a content type here
      [if tag="apple"]
    Do what you want with apples
    [else]
    [-if tag="orange"]
    Do what you want with Oranges
    [/-if]
    [/if]
    [/loop]
    Thread Starter richardtoth

    (@richardtoth)

    Thanks, I’m improving myself in coding, read more docs, thanks for the idea.
    r

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

The topic ‘Loop – exclude post with TAG… How to?’ is closed to new replies.