• I am sorry i am opening this topic, i know there is alot of similar ones already opened but each topic has slightly diferent code than i do so since im new to wrdpress i cant get it to work wen i integrate solutions from those posts to my code.

    I am using a loop like this:

    query_posts(array('category_name'=>'somecategory', 'posts_per_page'=>'5','paged' => get_query_var('paged')));
    while (have_posts()) : the_post();
    
    //stuff
    the_field('mydate'); //the output is: dd. MM yy (7. October 2013)
    //stuff
    
    endwhile;
    wp_reset_query();
    //paginate_links code...

    Plz show me how do i sort posts by custom field: the_field(‘mydate’);
    I would like the newer dates that are entered in this field to be before older ones. Thx

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Sort posts by custom field – date’ is closed to new replies.