WordPress.org

Support

Support » How-To and Troubleshooting » Sorting by meta value

Sorting by meta value

  • $params=array(
    ‘posts_per_page’=> 50,
    ‘post_type’ => array(‘type1′,’type2′,’type3’),
    ‘post_status’ => ‘publish’,
    ‘meta_key’=>’homepageorder’,
    ‘paged’ => $paged,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’
    );

    $wp_query = new WP_Query($params);

    this is my query.
    No matter what i do, the i can not order the results.

    Can anyone help me here.

  • The topic ‘Sorting by meta value’ is closed to new replies.