Thanks for opening a new thread on this topic. Much appreciated.
I have never used WP bakery post grid, much less the custom sorting order…
WPBakery gives the option to sort based on meta-values among others
This plugin uses a custom table to store the order. It then uses posts_where and posts_orderby wp hooks to modify the request query.
So if wp bakery works with std query functionality it should work out of the box…but i am guessing it doesn’t since you’re asking. So you need to see if wp bakery skips query filters such as the get_posts function which suppresses filters by default and therefore does not render the custom order.
Thank you for your response @aurovrata. WPBakery gives you the option to have its data source based on a custom query_posts(), but i’m struggling on how i can get this sorted table
can you debug your $query object and print out its SQL to make it has the WHERE clause and ORDERBY tagged on by the plugin?
I sorted out what the issue was… i was typing a query like
$args = array(
'post_type' => 'post',
'category_name' => '_Featured_3',
'order_by' => 'menu_order'
);
$query = new WP_Query( $args );
but instead i should type post_type=post&category_name=_Featured_3&orderby=menu_order
Now it’s working excellently!!
Thanks for your efforts!
-
This reply was modified 8 years ago by
gasmas75.
Wonderful. Glad you got it working
Hi,
I couldn’t create a category filter with a custom query as indicated in this topic but I found another solution that may help other users.
To apply the custom order (created with this plugin) for the wpbakery post grid (without a custom query, just using the standard choice “data source” tab, “narrow data source” tab, and selecting “Post order by Id” and “Descending” in data settings), you need to modify the module filters as reported here:
https://wpml.org/forums/topic/visual-composer-custom-grids-problem/
In /js_composer/include/classes/shortcodes/vc-basic-grid.php, set suppress filter to false instead of true
Current code:
‘suppress_filters’ => apply_filters( ‘vc_basic_grid_filter_query_suppress_filters’, true ),
Fix:
‘suppress_filters’ => apply_filters( ‘vc_basic_grid_filter_query_suppress_filters’, false ),
And that’s it.
Hope this helps,
And thanks for the plugin!
Enzo