Support

Account

Home Forums Front-end Issues Customize main query to sort by ACF number field Reply To: Customize main query to sort by ACF number field

  • I don’t see any reason why this would not work

    
    $query->set('orderby', 'meta_value');    
    $query->set('meta_key', 'tas_album_order');    
    $query->set('order', 'DESC');
    

    I can’t debug why you are getting the error without knowing the exact errror.
    https://wordpress.org/documentation/article/debugging-in-wordpress/