Title: adrian271's Replies | WordPress.org

---

# adrian271

  [  ](https://wordpress.org/support/users/adrian271/)

 *   [Profile](https://wordpress.org/support/users/adrian271/)
 *   [Topics Started](https://wordpress.org/support/users/adrian271/topics/)
 *   [Replies Created](https://wordpress.org/support/users/adrian271/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/adrian271/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/adrian271/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/adrian271/engagements/)
 *   [Favorites](https://wordpress.org/support/users/adrian271/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: Post Expirator] Loop code for sorting by expiration date?](https://wordpress.org/support/topic/plugin-post-expirator-loop-code-for-sorting-by-expiration-date/)
 *  [adrian271](https://wordpress.org/support/users/adrian271/)
 * (@adrian271)
 * [16 years ago](https://wordpress.org/support/topic/plugin-post-expirator-loop-code-for-sorting-by-expiration-date/#post-1448029)
 * Maybe I can get you started with what I have. I only used this to sort and show
   one event but you can probably build this. I eventually want to make it so that
   when somebody clicks on an events category it specifically sorts these by expiration…
   I’ll post that later when it’s done.
 * But for now here is what is on my home.php page:
 *     ```
       <?php 	$events_query = new WP_Query('category_name=upcoming-events&showposts=1&order=ASC&meta_key=expiration-date&orderby=meta_value');
       while ($events_query->have_posts()) : $events_query->the_post(); 	?>
       <div id="events">
          <p>Come to our event:  <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a> </p>
       </div>
       <?php endwhile; ?>
       ```
   
 * So as you can tell this is for events and I have this only displaying one event,
   the next upcoming event.
 * Now if I could only get that data from the post expirator and use it to display
   the event date… but that’s is a different battle.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Post Expirator in template](https://wordpress.org/support/topic/post-expirator-in-template-1/)
 *  [adrian271](https://wordpress.org/support/users/adrian271/)
 * (@adrian271)
 * [16 years ago](https://wordpress.org/support/topic/post-expirator-in-template-1/#post-1300864)
 * This thread shows as resolved but I don’t see a resolution. Is there one? I am
   looking for the same information.
 * Alternatively, maybe there is something you can do with the meta-data that post
   expirator automatically creates. I’m not familiar enough with PHP to make that
   happen but if anyone knows that would be great.
 * Thanks

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