• Resolved williamweber

    (@williamweber)


    I have a situation where I want to show all posts in one loop on a page except ones of a certainly post_format (not sure if this is a custom taxonomy created by my theme or a built in one).

    And then in another loop I want to show all of the posts from that post_format.

    I’ve got the second loop working:

    [loop type="post" taxonomy="post_format" value="post-format-link"]
    [content field="title"]
    [/loop]

    But I don’t really know how to do the first loop, or even if I can without adding some sort of custom field. Regular posts are just set to a format of “standard” which doesn’t add a post_format to the post at all.

    https://simplify.bi

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

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

    (@miyarakira)

    Hmm, I see your situation – currently there is no parameter to exclude posts by taxonomy value.

    There is a parameter called compare, with which you can exclude posts by custom field value: compare="NOT EQUAL" – so I can make the same available for taxonomy, something like:

    [loop type="post" taxonomy="post_format" compare="NOT" value="post-format-link"]

    OK, I’ll try implementing it. Interesting point about regular posts not having a post_format, I hadn’t realized this.

    Plugin Author Eliot Akira

    (@miyarakira)

    I added the compare parameter for taxonomy queries. Please see version 0.7.8. So, just as I described above, if you add compare="NOT", this should exclude posts with that taxonomy value.

    Thread Starter williamweber

    (@williamweber)

    So awesome that you responded so fast to this. I updated and tried the new compare parameter in the loop but I’m still seeing those “post-format-link” posts the in the first loop.

    And just to make sure I’m not doing something wrong. I’m copying the exact code I have in both text boxes on my site:
    Working:
    [loop type="post" taxonomy="post_format" value="post-format-link"]

    Not working:
    [loop type="post" count="4" taxonomy="post_format" compare="not" value="post-format-link"]

    Thanks again, you are awesome. I absolutely love your plugin.

    Plugin Author Eliot Akira

    (@miyarakira)

    Hmm, so

    taxonomy="post_format" compare="NOT" value="post-format-link"

    isn’t working?

    I’ve made various post formats and tested these parameters, and it looks to be excluding the right posts. I wonder what could be different..?

    Ah, the compare parameter is case-sensitive! (compare=”NOT”) I’ll change that to be case-insensitive. One moment..

    Plugin Author Eliot Akira

    (@miyarakira)

    OK, with the latest update to 0.8.0, compare (and relation for custom field query) are case-insensitive. I think that should solve it.

    Thread Starter williamweber

    (@williamweber)

    Brilliant! That did it.

    Having it case-insensitive will be helpful (for when I get lazy) but now it works perfectly.

    I just want you to know that this plugin is great. I’m going to be using it to drive basically all the content pages on my site now that you added this one feature.

    If you have a donate link somewhere please let me know. I have no problem contributing to things I find useful, and I really find this useful ??

    Thanks.

    Plugin Author Eliot Akira

    (@miyarakira)

    Wonderful, I’m happy to hear you’ve found good use for the plugin. As you can imagine, I use it extensively on basically all sites I build. One thing it’s missing is a pagination feature, one day I’d like to tackle this and find a simple solution.

    For the last couple of months, I’ve been developing a premium extensions library that works with the content shortcode, called Custom Toolbox. I’m aiming for an easy way to put content in layout, slider, lightbox, dropdown, etc. I’ve got the bulk of it built, and I’m currently working on the update feature (through the admin panel like native/free plugins). If you could keep me in mind, I hope to get it ready soon, and I’d love to hear your opinion.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show all posts except certain ones’ is closed to new replies.