• The ‘orderby’ value of ‘meta_value’/’meta_value_num’ no longer appears to work properly in 3.4.x. I’ve got a plugin to add a custom post type for video media, and in 3.3.2, the following query works just fine:

    $args = array(
    		'numberposts' => -1,
    		'post_type' => 'video',
    		'meta_key' => 'videoOrder',
    		'orderby' => 'meta_value_num',
    		'order'=>'ASC',
    		'post_status'=>'publish'
    );
    
    $videos = get_posts($args);

    The same code, however, does not work in 3.4.x. The order and orderby parameters seem to be ignored. Again, it works just fine in 3.3.2, but not in either 3.4 or 3.4.1. Is anyone else having similar issues?

Viewing 1 replies (of 1 total)
  • Hi.
    The problem could be coming from your numberposts value. Try changing to a positive integer greater than 1 to see if the sort method works.
    Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Ordering Custom Posts by Custom Fields not working’ is closed to new replies.