[EventCalendar] Hide Post Timestamp

Marc Griffin marc at overallquilter.com
Tue Jan 2 17:06:16 UTC 2007


That did it! Thanks again for your help!

 

Marc

 

  _____  

From: Steve Winton [mailto:stevewinton at gmail.com] 
Sent: Tuesday, January 02, 2007 12:01 PM
To: Marc Griffin
Cc: Support for EventCalendar plugin
Subject: Re: [EventCalendar] Hide Post Timestamp

 

Hi Marc,

Try this:

function mg_filter_the_date($the_date)
{
  global $ec3;
  $event_cat = get_option('ec3_event_category');

  if (!empty($ec3) && (in_category($event_cat) || is_category($event_cat))) 
  {
    $the_date = ''; // An empty string!
  }
  return $the_date;
}

add_filter('the_date', 'mg_filter_the_date');
add_filter('the_time', 'mg_filter_the_date'); 

This is *untested*, but I've added a check to see that EC3 is installed,
since there's a dependency on the ec3_event_category option. Also, I've
renamed the function, to mg_filter_the_date, to help avoid any possible
naming conflicts! Hopefully that will work for you! 

Cheers,
Steve

On 1/2/07, Marc Griffin <marc at overallquilter.com> wrote:

Hi Steve,

 

It works beautifully as a plugin . returning the date of the event instead
of the creation date. Forgive me, but I'm not a developer ... how would I
set $the_date to an empty string so that I can hide it completely?

 

Thanks for your help!

 

Marc

 

  _____  

From: eventcalendar-bounces at firetree.net [mailto:
<mailto:eventcalendar-bounces at firetree.net>
eventcalendar-bounces at firetree.net] On Behalf Of Steve Winton
Sent: Tuesday, January 02, 2007 6:01 AM
To: Support for EventCalendar plugin
Subject: Re: [EventCalendar] Hide Post Timestamp

 

Hi Marc

You could either edit your theme's loop, and put a conditional statement
around calls to 'the_date()', checking for the post category before
displaying it. However, since the_date() could be called from multiple
places in your theme, you may want to use a filter on 'the_date' and
'the_time', which is what I've done, something like: 

function 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', 'filter_the_date');
add_filter('the_time', 'filter_the_date');

Note, that I'm using the event schedule in place of the date the event was
created. You could just set $the_date to an empty string to hide it
completely. You could either stick the above in your theme's functions.php
file, or create a plugin.

Hope that helps,
Steve

On 1/1/07, Marc Griffin <marc at overallquilter.com
<mailto:marc at overallquilter.com> > wrote:

Hello,

 

I would like to hide the post timestamp for posts in the calendar event
category only (the timestamp for when the event was created . the one above
the event date in the red box). I've searched the archives for a solution
with no luck.

 

Thanks!


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

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20070102/a6e082c4/attachment.html


More information about the EventCalendar mailing list