Friday, March 8, 2013

How to Sort mails by mail Expiration Date in WordPress

In our particular task, we had Events as a made-to-order Post kind. Now this is for a non-profit that holds like one happening per month, so we easily created a loop to put in their events sheet. You can use the cipher in your sidebar, or any place additional you want.

 'event', 'posts_per_page' => 15, 'order' => 'ASC', 'meta_key' => 'expiration-date', 'orderby' => 'meta_value' ); $eventloop = new WP_Query( $args ); if ( $eventloop->have_posts() ) : while ( $eventloop->have_posts() ) : $eventloop->the_post(); //All the Loop Content Goes Here endwhile; endif; ?>

0 comments:

Post a Comment