Visual Composer: Page Builder for WordPress by WPBakery is an incredible tool. We use it on almost every project now to give the client a massive amount of control over their content without adding any complexity. Recently VC received an upgrade which included Grid Elements, here’s a video showing off the basics:
As you can see, pretty powerful stuff. This “Grid” update (4.4) also brought changes to the Post Grid element.
Before the update the Post Grid element used to have a query builder when it was used with custom post types. This allowed you to select the post type to query and also any custom taxonomies associated with that custom post type (categories and tags). However the new Post Grid has none of this and instead features a very plain Custom Query text box:
The advice below the text box is to formulate your query using this page, unfortunately that codex page covers many ways to create a query, and what the Post Grid settings is after isn’t in the WPBakery documentation (at least I couldn’t find it!)
After some trial and error and a lot of things not working (too many!), it turns out we need to use a query string, with no surrounding PHP. Such as:
Or, if used with a custom post type such as ‘package’ on a custom taxonomy like ‘package-tag’ with a tag slug of ‘premium’:
I like the fact that it’s a custom query string now, it’s just as powerful as the old query builder, if not more so. I’m also a big fan of the new Grid Elements as often themes come with custom post types which go unused because of the way they are displayed (think ‘Staff’ or ‘Testimonies’). This blows them wide open for easy customisation.
Cross post from my blog.