[EventCalendar] Show next event on front page

Alf Haakon Lund alf at galleritexas.no
Sat Jun 2 09:32:06 UTC 2007


Thank you very much!

The two loops absolutely does the trick. A few unexpected side effects  
because of my settings (i made a tweak to EC to show multiple category  
posts on the front page even if EC says "hide", so I got some double  
postings - easily fixed, though!), but now I'm ready to rock with loops.

Alf



Den 01-06-2007 skrev Mark Naylor:

> Hi Alf,
> 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... -->
>   <?php endwhile;?>
>
> Mark
>
> -----Original Message-----
> 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
>
> Hello there,
>
> 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:
>
> Sidebar:
>    List of upcoming events and calendar.
>    Links, search, meta, etc
>
> Main section:
>    <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!
>
> Alf
>
>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>






More information about the EventCalendar mailing list