[EventCalendar] Create Page with Events Only

Mark A. Soho adamsoho at adamsoho.com
Sun Feb 25 17:12:47 UTC 2007


Yea, that code is nice.  You can also make it a plugin by sticking it 
into your plugins folder as, say, datefilter.php, and simply add the 
following to it in order for it to show up in your plugin management page:

<?php
/*
Plugin Name: Event Date Filter
*/
?>

Matt Dawson wrote:
> So here it is. My apologies to whomever wrote this function - I can't 
> find it on the mailing list archive.
>
> Take the following code and save it in your theme's folder as 
> functions.php. If a functions file already exists, just paste it into 
> that doc.
>
> <?php
>
> function mg_filter_the_date($the_date)
> {
>   $event_cat = get_option('ec3_event_category');
>   if (in_category($event_cat) || is_category($event_cat))
>   {
>     $the_date = ec3_get_schedule('%s ','%1$s %3$s %2$s. ','%s');
>   }
>   return $the_date;
> }
>
> add_filter('the_date', 'mg_filter_the_date');
> add_filter('the_time', 'mg_filter_the_date');
>
> ?>
>
> This looks at the event category for your site, and if the post in 
> question is in that category, it calls ec3_get_schedule and reassigns 
> that info as the posts date/time. Of course, this means that you can't 
> access the post date anymore. So if you have a situation where you 
> need to show both the event date and the post date, this isn't a 
> viable option.
>
> If you're the original author, stand up and be thanked. I owe you one.
>
> Matt
>
> On 2/23/07, *Michael Schumann* < lanval at gmail.com 
> <mailto:lanval at gmail.com>> wrote:
>
>     Hi Matt,
>
>     If you could post this trick that would be great! :)
>
>     Michael
>     On 23-Feb-07, at 3:57 PM, Matt Dawson wrote:
>
>>     It's worth noting that I'm also using a function in my theme that
>>     substitutes event date info for post date info for any post
>>     marked with my events category. This allowed me to snag the event
>>     date by calling the_time(). I got that trick from this mailing
>>     list, but I can repost if it would be helpful to others.  
>
>
>     _______________________________________________
>     Blog: http://wpcal.firetree.net/
>     EventCalendar at firetree.net <mailto: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
>
>
>
> __________ NOD32 2080 (20070225) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>   




More information about the EventCalendar mailing list