[EventCalendar] Keeping events separate & showing events on front page

karl kolk karlkolk at googlemail.com
Sun Jan 25 09:55:15 UTC 2009


On Sat, Jan 24, 2009 at 10:45 PM, Alex Tingle <alex at firetree.net> wrote:
> Hi Karl,
>
> 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 ec3.2.
>> 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 this...
>
>  <?php
>   global $wp_query;
>   if(is_home() && empty($wp_query->query))
>     query_posts("YOUR QUERY");
>  ?>
>
>

as i obviously do not know what some of the code does that floats around my docs
the eeek line was quickly removed.

>> 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 haven't.
>
> Add ec3_listing=events to the URL, and that will do what you want.
>

problem is, when having events as normal posts and i try to list them
in chronological order
with ec3_listing=events or ec3_after=today the result is still in posting order.

you can watch it happen at www.elbeseiten.org. the front page is the
standard index-loop
and clicking 'chronologisch sortieren' (sort chronologically) calls
ec3_listing=events.
the four posts (which should be the next upcoming 4) at the sidebar
are called with
ec3_after=today.

any suggestions to get the desired result?


> Probably the neatest way to do that is to add rewrite rules in your
> .htaccess file.
>
>

i'd rather won't mess with that file, just because eeek could turn oh
**** much too fast.

 >> 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?
>>
>> brainbroken
>> karl
>>
>> 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.
>
> -Alex
>
it was more something like a wish and i'm glad you put it into effect
so, no credit needed :)

Karl

>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>



More information about the EventCalendar mailing list