Skip to main content
added 112 characters in body
Source Link
Brad Dalton
  • 7k
  • 2
  • 36
  • 47

Don't use query_posts.

$the_query$meta_query = new WP_QueryWP_Meta_Query( $args$meta_query_args );

$args$meta_query_args = array(
   'post_type' => 'services',
    'order'     => 'ASC',
    'meta_key' => 'your_key',
    'orderby'   => 'meta_value', //or 'meta_value_num'
    'meta_query' => array(
                    array('key' => 'order_in_archive',
                        'value' => 'some_value'
)));

Use the WP_Meta_Query parameters

Don't use query_posts.

$the_query = new WP_Query( $args );

$args = array(
   'post_type' => 'services',
    'order'     => 'ASC',
    'meta_key' => 'your_key',
    'orderby'   => 'meta_value', //or 'meta_value_num'
    'meta_query' => array(
                    array('key' => 'order_in_archive',
                        'value' => 'some_value'
)));

Don't use query_posts.

$meta_query = new WP_Meta_Query( $meta_query_args );

$meta_query_args = array(
   'post_type' => 'services',
    'order'     => 'ASC',
    'meta_key' => 'your_key',
    'orderby'   => 'meta_value', //or 'meta_value_num'
    'meta_query' => array(
                    array('key' => 'order_in_archive',
                        'value' => 'some_value'
)));

Use the WP_Meta_Query parameters

added 1 character in body
Source Link
Brad Dalton
  • 7k
  • 2
  • 36
  • 47

Don't use query_posts.

$the_query = new WP_Query( $args );

$args = array(
   'post_type' => 'services',
    'order'     => 'ASC',
    'meta_key' => 'field_1''your_key',
    'orderby'   => 'meta_value', //or 'meta_value_num'
    'meta_query' => array(
                    array('key' => 'order_in_archive',
                        'value' => 'some_value'
)));

Don't use query_posts.

$the_query = new WP_Query( $args );

$args = array(
   'post_type' => 'services',
    'order'     => 'ASC',
    'meta_key' => 'field_1',
    'orderby'   => 'meta_value', //or 'meta_value_num'
    'meta_query' => array(
                    array('key' => 'order_in_archive',
                        'value' => 'some_value'
)));

Don't use query_posts.

$the_query = new WP_Query( $args );

$args = array(
   'post_type' => 'services',
    'order'     => 'ASC',
    'meta_key' => 'your_key',
    'orderby'   => 'meta_value', //or 'meta_value_num'
    'meta_query' => array(
                    array('key' => 'order_in_archive',
                        'value' => 'some_value'
)));
Source Link
Brad Dalton
  • 7k
  • 2
  • 36
  • 47

Don't use query_posts.

$the_query = new WP_Query( $args );

$args = array(
   'post_type' => 'services',
    'order'     => 'ASC',
    'meta_key' => 'field_1',
    'orderby'   => 'meta_value', //or 'meta_value_num'
    'meta_query' => array(
                    array('key' => 'order_in_archive',
                        'value' => 'some_value'
)));