For that you need to write a complex query for it and need to use filter. It should be like this and you need to keep in your functions.php of your theme file.
add_filter('wmlp_query', 'my_custom_query_wmlp',10,2);
function my_custom_query_wmlp($args, $shortcodeID){
if ($shortcodeID == 2){ //WHERE 2 should be replaced with your shortcode ID
$today = date('Ymd');
$args['meta_key'] = 'eventstart';
$args['meta_query'] = array(
array(
'key' => 'eventstart',
'value' => $today,
'compare' => '>='
)
);
$args['orderby'] => 'meta_value_num';
$args['order''] => 'ASC';
return $args;
}
}
Hope this helps. Also, please make sure your date is in YMD format.
I tried your query, but it doesn’t work (even after I fixed the double ‘ in $args[‘order”]). It returns a blank page and the error Parse error: parse error in website/functions.php on line 380:
$args[‘orderby’] => ‘meta_value_num’;
Could this have something to do with the YMD format? Where do I change this? Because I’m using jMY in my website…
Have you used the full code in your functions.php that i sent in above ?
If so and it is still not working, there might be some other issue and field name conflict. So to check this in details, please kindly send me your wp-admin details, url using our form at http://www.masonrylayout.com/rectify-my-problem/.
Sorry for the delay in reply due to weekend. Ya i have got the details and i was working for it few hrs back. But couldn’t make it work. I am still trying with other solution.
Please allow me extra next 24 hrs.
Thanks
Author
Posts
Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Pro Version’ is closed to new topics and replies.