Custom Query

Home Forums Pro Version Custom Query


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #11404
    Ben De Troyer


    I’m trying to get the order of my events right. It should be ordered by event start date (‘eventstart’) and Ascending. When I use following code, it works fine for the shortcode with ID 1 (in my case). But the problem is: my other shortcodes don’t work anymore! (I used WP Masonry Layout for a few custom post types, but this function should only be working for the shortcode with ID 1).

    add_filter(‘wmlp_query’, ‘my_custom_query_wmlp’,10,2);
    function my_custom_query_wmlp($args, $shortcodeID){
    if ($shortcodeID == 1){
    $args = array(
    ‘orderby’ => ‘eventstart’,
    ‘order’ => ‘ASC’
    return $args;

    In the field “custom query” i put the following: wmlp_query

    Could someone please help me with this?

    Masonry Guy

    Hi Ben,

    The code looks good and should work fine. So other shortcode are you getting any error ?

    You don’t need to keep any thing in custom query box if you are using filter. Or you can remove the filter and just use this in custom query box orderby=eventstart&order-ASC

    Hope this helps.


Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Pro Version’ is closed to new topics and replies.