[EventCalendar] Keeping events separate & showing events on front
alex at firetree.net
Sat Jan 24 21:45:38 UTC 2009
On 24 Jan 2009, at 20:51, karl kolk wrote:
> i started using eventcalendar in mid november '06 making use of a bug
> in version 3.1.rc4 that showed the events on the front page even when
> using the keep events separate option.
> i recently upgraded the site to wp2.7 and the latest dev.ver. of
> it is an online mag just posting concerts and exhibitions in hamburg
> germany that too
> often fly under ones radar. basically every post is an event.
> the front page should display events in posting order and in the
> sidebar the next 4
> upcoming events should be shown chronologically.
Isn't that the behaviour you get when you set "Events are normal
posts" (rather than "Keep events separate")?
I think you should start with "Events are normal posts", and then
address the rest of your requirements.
> i have set the option to keep events separate and managed to get the
> desired content
> on the front page. my loop starts like this:
> <?php if (have_posts()) : ?>
> <?php query_posts('ec3_listing=disable'); ?>
> <?php while (have_posts()) : the_post(); if (is_home()) ?>
Eeek! Don't do that!
Your first call to have_posts() is looking at the normal default
query, but the second one is looking at the new query you've
defined... the result will be very unpredictable, I imagine.
I think it's best to avoid using query_posts() in your index.php. If
you insist on doing so, then wrap it into a protective "if", like
if(is_home() && empty($wp_query->query))
> unluckily all archives (archive-, category and 'next posts'-pages)
> are empty,
> even if i start the archive.php the same way as the index one.
> from what i understand from the mailing-list discussions this is
> somewhat intended
> by alex but not what i want.
> i'd like to have event specific queries to behave like i have set
> 'keep events separate'
> but the rest of the wordpress (post-pages) should behave like i
Add ec3_listing=events to the URL, and that will do what you want.
Probably the neatest way to do that is to add rewrite rules in
your .htaccess file.
> if someone likes to help, but doesn't get my english-kauderwelsh
> ('gibberish'), you might
> find it helpful to have a look @ the site: http://www.elbeseiten.org
> hints anyone?
> PS: thx alex for implementing the 'iconlets' - the 2 years wait was
> all worth it.
> the plugin totally rocks our site.
Yeah, wasn't that you idea? I should have credited you.
More information about the EventCalendar