• I am in desperate need of some guidance from the experts here. I’m trying to create a simple events listing for concerts, where the next upcoming concert would always appear on top (much like the static concert calendar on http://www.harpjas.com/calendar.php, the site I’m trying to migrate into WP).

    The trick is that I need expired events to be auto-archived (or at least hidden from display) after they pass. I was excited when I discovered Shirkee’s events plugin at http://www.sothq.net/forum/events-plugin, but unfortunately I couldn’t get it to work, and little support was offered in the forums there.

    I’m trying a workaround for this, which involves the two plugins found on this site:

    http://wunder-ful.com/wordpress-plugins

    Posts_Begin and Posts_Expire

    The first one is necessary to get around the fact that WP usually doesn’t show posts from the future, and Posts_Expire allows me to “fake” the auto-expiry function I mentioned before.

    Now – the last bit: I entered in three events as a test, two concerts in February and one in October (with the end_dates being the day after the “title” day, which is the actual concert date). WP is still ordering them by ACTUAL post-date, and I need to devise a way to order them by the end_date, which in this case is a kind of custom field.

    I’ve read the order by custom field threads but I don’t have the php knowledge to be able to know where to plug in the necessary information. At this point I’d be willing to shell out some $$ for some help. There must be a way to insert an $orderby function or something…

    any advice is greatly appreciated! thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Check http://www.sothq.net/forum/events-plugin,
    again, He just updated this plugin.
    Hope it helps.

    What was the URL of the order by custom field thread? I’m in a very similar situation as you: need to display events in chronological order, with start and end date, hide but archive old events.

    Event Calendar seems to have the infrastructure for that (at least the entering data part, and the archiving, as events are normal posts), but I don’t really know where to start to (a) change the display order and (b) hide posts where the event end date is past.

    was there a resolved fix for this? I have my site allowing future posts to be displayed and I am pulling them in fine, but can’t work out the code to expire past posts

    <?php $my_query = new WP_Query(‘cat=3,8&showposts=7&orderby=time&order=asc’); ?>

    Can anything be added to this or should I be using something else? Ideally I want to be able to do it just in the code as opposed to additional plugins, ie, could something like

    &HIDE POSTS PUBLISHED BEFORE TODAY FROM THIS LIST

    OK, SO I HAVE RESOLVED THIS (after about 12 hours dev time – I think!)

    I required a query that would allow me to show future events on a sidebar, and have them disappear once today’s date has passed. This is the fix.

    First off, I used the wonderful plugin “The future is now”
    Plugin URI: http://birdhouse.org/software/futurepost

    Installing this allows you to publish future posts and have them appear on your page.

    Ok, so that done, I want my sidebar to pull said posts from varying categories, so I implemented the line before the loop as:

    <?php $my_query = new WP_Query('cat=3,8&showposts=7&orderby=time&order=asc'); ?>

    This tells it to oull from categories (3 & 8) and show 7 posts thereof, order from today forwards. However, this only allows to pull in all posts published.

    I wanted it to hide posts/events from previous dates. So the fix is borrowed from:
    http://wordpress.org/support/topic/140060?replies=3

    However, with a few tweeks… this is the final code (with ‘1’ being the main fixer (stopping anything posted before today)

    <?php $my_query = new WP_Query('cat=3,8&showposts=7&orderby=time&order=asc'); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <?php
    $mylimit=1*(60*60*24);
    if ( (current_time(timestamp) - get_the_time('U') - (get_settings('gmt_offset') * 3600) ) < $mylimit)
    {
    ?>

    you will then need to replace the end of the loop

    </div>
    
    <?php endwhile; ?>

    to:

    </div>
    <?php } ?>
    
    <?php endwhile; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Creating an events list: how to order dates by post_expire’ is closed to new replies.