• Resolved Argentum

    (@argentum)


    Hi!

    Great plugin collection. I am especially thrilled about the Post Carousel.

    I wonder if you could give me a hint how to use the “Additional query arguments” field. I want to show post that belong to category 2 AND 6 (for instance). The standard behaviour seems to be OR. Can I enter this in the Additional query arguments field, or?

    
    $query = new WP_Query( array( 'category__and' => array( 2, 6 ) ) ); 
    

    I had a bad experience adding something to a widget that broke my site totally, having to dive deep into the DB with Phpmyadmin. 🙂

    Thanks in advance for any help!
    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author livemesh

    (@livemesh)

    The default behavior of Taxonomies field is OR – that’s right. Unfortunately there is no way to specify an AND with additional query arguments as well. A query argument like cat=4&cat=5 can be used but that behaves exactly like OR.

    One solution I can think of is to target these posts by specifying the posts manually in Post in.

    Other way is to have a wordpress filter on ‘siteorigin_widgets_posts_selector_query’ in your theme. You can modify the query passed to you in the filter to have the query above provided by you.

    Thread Starter Argentum

    (@argentum)

    I’ll have to work around it then with more than one instance of the Post Carousel. Not much of a programmer (yet). Thanks anyways!

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

The topic ‘Additional query arguments Post query format’ is closed to new replies.