Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter thairish

    (@thairish)

    Hi Paul,

    Thanks a lot your information helped me resolve it. I changed the meta_key to “custom_order” for my custom field and the query ordering worked! Saved me hours of headaches trying to figure this out.

    If it helps anyone my updated $args array for the query is:

    $args = array(
    ‘post_type’ => ‘download’,
    ‘meta_key’ => ‘custom_order’, //Changed the meta key to not have the starting underscore
    ‘orderby’ => ‘meta_value_num’,
    ‘order’ => ‘DESC’,
    );

    Regards,

    James

    • This reply was modified 8 years, 4 months ago by thairish.
    Thread Starter thairish

    (@thairish)

    Just fixed this, need to wrap the custom code in:

    jQuery(document).ready(function(){
    //Custom code
    });

Viewing 2 replies - 1 through 2 (of 2 total)