adrian271
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: Post Expirator] Loop code for sorting by expiration date?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
In reply to: Post Expirator in templateThis 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