[EventCalendar] Single Category Page and code/tag
Matt Dawson
matthewtdawson at gmail.com
Thu Mar 15 14:14:38 UTC 2007
A while back, I posted a function originally written by the inimitable
Mr. Steve Winton.
http://penguin.firetree.net/pipermail/eventcalendar/2007-January/001306.html
Steve eventually posted a revised version that I can't find in the
archives. I use it on one of my sites. Here it is:
<?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');
?>
Put this function in a file called filters.php in your theme's folder.
What this will do is change the posted date to the event date for all
posts marked with your events category - whatever that may be. The
only downside to this is that it essentially overwrites the posted on
date - so you won't be able to display both at the same time.
>From your explanation, it sounds like that won't be an issue for you.
(Would be nice to have a url of your site for these purposes.)
Matt
On 3/15/07, Bert Mahoney <berchman at mac.com> wrote:
> Hi,
>
> Thought I would share what I found.
>
> I wanted to display all future calendar events on a page lisiting
> soonest event on top and older events following.
>
> I didn't want other posts mingling in. I found a WP plugin that will
> allow you to create a single-category template and will allow you to
> have just posts in that category (calendar category) show up on this
> page:
>
> http://tinyurl.com/ytk46s
>
> The pages is working however problem is now when the items are
> displayed they show their posting date NOT their event date. Here is
> the code that generates each listing in my template:
>
>
> <?php while (have_posts()) : the_post(); ?>
> <div class="post">
> <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>"
> rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php
> the_title(); ?></a></h3>
>
> >>> <small><?php the_time('l, F jS, Y') ?></small>
>
> <div class="entry">
> <?php the_content() ?>
> </div>
>
> <p class="postmetadata">Posted in <?php the_category(', ') ?>
>
> </div>
>
> <?php endwhile; ?>
>
>
> The code marked with the ">>>" is what generates the posted date.
> I need the event date. I have looked online at the documentation and
> was thinking I could use
>
> %DATE% - The date of the post.
>
> but I don't know how to use that within the constraints of the loop
> above.
>
> Anyone have an idea how I can change that one line of code to get
> what I need?
>
> Thanks,
> Bert
>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
More information about the EventCalendar
mailing list