WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
Get post by DESC , ASC from custome field DATE picker (1 post)

  1. sojitrakrunal24
    Member
    Posted 3 months ago #

    i want to custome post by ASC. i have some add some post in bachend one of the field date picker. i want to post by date which i set in date picker field

    <?php
    			$args = array(
                     'post_type'=>'upcoming_events',
    				 'order' => 'ASC',
    
               );
    			global $more;
    			query_posts( $args );
    			while (have_posts()) : the_post();
    			?>
    
    <p><?php the_title(); ?></p>
    <?php $postdate = date('d-m-Y' , strtotime(get_field('date')));
    	echo $postdate;  ?>
    <?php endwhile;?>

    Ex.
    some post which i set date(datepicker cusomefiled) and title output is below
    DATE(datepicker) title

    19-12-2013 London
    29-12-2013 Spain
    15-01-2014 Paris

    i want to

    DATE(datepicker) title

    15-01-2014 Paris
    19-12-2013 London
    29-12-2013 Spain

    http://wordpress.org/plugins/advanced-custom-fields/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 3 months ago by sojitrakrunal24
  • This topic is not resolved
  • WordPress version: 3.7.1