Orderby in an array

Asked

Viewed 38 times

4

Fellas, I’m trying to edit a array, so that it can provide me with the information in ascending or descending order.

I’m doing it this way:

$Recent_Page = get_post_meta(get_the_ID(), 'imic_home_recent_property_no', true);
query_posts(array('post_type'=>'property', 'post_status'=>'publish', 'orderby'=>'ID', 'order'=>'ASC','posts_per_page', =>$Recent_Page));

Nothing happens. What can I be missing?

1 answer

2

In accordance with example of wordpress Codex on query_post, goes below:

$Recent_Page = get_post_meta(get_the_ID(), 'imic_home_recent_property_no', true);

$args = array(
    'post_type'=> 'property',
    'post_status'=>'publish',
    'orderby'=>'ID',
    'order'    => 'ASC',
    'posts_per_page' =>$Recent_Page
);
query_posts($args);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.