WordPress.org

Ready to get started?Download WordPress

Forums

Display Posts Shortcode
[resolved] Posts in two categories (5 posts)

  1. richardjay
    Member
    Posted 1 year ago #

    Is it possible to return excerpts of only those posts that are in the "forex-2" and "reviews" categories ? At the moment I'm getting any post in either category.

    http://wordpress.org/extend/plugins/display-posts-shortcode/

  2. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    I haven't tried it, but this might work:

    [display-posts category="forex-2+reviews"]

  3. Jeffrey Driver
    Member
    Posted 1 year ago #

    Glad I found this post. I was just looking for the same thing. However, it doesn't seem to work (at least not how I was hoping it would) as it will return posts with either one of the given categories, and not just those with both. At the moment I'm having to create long, descriptive categories.

    It would be great to see some boolean operators to help filter results further. This would make an already great plugin much more powerful.

  4. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    I thought the + was a shorthand for boolean operators in WordPress, but I guess not.

    Boolean operators are supported, it's just a little more complicated:

    [display-posts taxonomy="category" tax_term="forex-2, reviews" tax_operator="AND"]

    You can even do the intersections or additions of multiple taxonomies. Let's say you want posts in the "forex-2" AND "reviews" category, AND it should be tagged "featured" AND "home".

    [display-posts taxonomy="category" tax_term="forex-2, reviews" tax_operator="AND" taxonomy_2="post_tag" tax_2_term="featured, home" tax_2_operator="AND" tax_relation="AND"]

    For more information, see the Multiple Taxonomy Queries section of the wiki.

  5. Jeffrey Driver
    Member
    Posted 1 year ago #

    That's fantastic. Thanks a lot Bill.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.