[EventCalendar] Show next event on front page
MarkNaylor at signet-solutions.com
Fri Jun 1 09:18:58 UTC 2007
I'm sure this could be done more elegantly, but here's what I would do.
I believe you could do that with 2 loops, the first looking for the
event category, and only one post of that.
The 2nd loop as usual.
Example code, from codex to list 1 post. There must be (tho I don't know
it) a variable you can ask for to sort the posts in the way you want.
// Get the last 1 posts in the event category.
<?php query_posts('category_name=event&showposts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Do special_cat stuff... -->
From: eventcalendar-bounces at firetree.net
[mailto:eventcalendar-bounces at firetree.net] On Behalf Of Alf Haakon Lund
Sent: 01 June 2007 09:53
To: EventCalendar at firetree.net
Subject: [EventCalendar] Show next event on front page
Currently running WP 2.1.3 and EC 3.1.1RC1
I'm sure this question must've been asked before, but I'm not able to
find the answers I need in the archives. What I want to do is customize
my template to achieve this on my main page:
List of upcoming events and calendar.
Links, search, meta, etc
<div> with full post on next event (be it today or next year)
<div> with standard posts (the blog)
Anyone able to help on this? Many thanks in advance!
EventCalendar at firetree.net mailing list
More information about the EventCalendar