Mobile app version of vmapp.org
Login or Join
Courtney195

: Custom query for Visual Composer's Post Grid in Word Press A site in Word Press. It has several custom post types. Each of them has several taxonomies that, coincidentally, are the same. Specifically:

@Courtney195

Posted in: #Post #QueryString #Wordpress

A site in Word Press. It has several custom post types. Each of them has several taxonomies that, coincidentally, are the same. Specifically:

- Press <-- CPT
- Country <-- Taxonomy
- Theme
- Department

- Resources
- Country
- Theme
- Department


I'm using Visual Composer and need to use the Post Grid module, which lets you create a custom query in "one-line" format such as posts_per_page=3&post_type=post&post_status=publish&orderby=date&order=DESC

THE QUESTION

What's the one-line query to output the most recent 5 posts from BOTH custom post types within the taxonomy "Country"?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

Found the answer! The string has to be URL-encoded containing an array for the field "post-type" and also the "[ ]" characters are not allowed so must output the url-encoded value which is %5B%5D.

post_type%5B%5D=press
&post_type%5B%5D=resources
&cat=country
&post_status=publish
&order_by=date
&order=DESC

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme