[EventCalendar] how to display date of event on archive page?

ejm llizard_ejm at yahoo.com
Sat Sep 2 23:20:48 UTC 2006


Many thanks for the reply, Alex. 


> I suggest that you create a special Category
> template for your event category...
> 
>   http://codex.wordpress.org/Category_Templates
> 
> ..in order that you can change the appearance JUST
> of the event category. I think you are already doing
> this, but I thought I'd spell it out, so that
> everyone knows what you're up to.

Actually, I wasn't quite doing that; I hadn't realized that this was
possible! I was using archive.php for this and didn't even have a
category page at all.  But I do now. Many thanks for pointing to the
wordpress codex. 

The wordpress theme I am using is an ancient one from when I first
started with wp. It was rather heavily modified by me back then and
I'm too lazy to revamp entirely. With this latest upgrade though, I
did manage to add sidebar, header, footer, etc. files.

> Let me know how you get on. If it works for you,
> could you post a copy of your category template so
> that other people can learn from it.

I'm happy to say that t is definitely working. I still have to do a
little tweaking in style because I have not taken the time to look at
the ec3 stylesheet to see what to override to get the date to display
differently from how it displays on the actual event posts.

I'm also still trying to work out how to show more than 7 titles on
the category pages. (I have wp set to show a maximum of 7 posts per
page and need to stare at various pages to find out how to override
that as well.)

I'm not sure that what I have come up with is the prettiest coding
(actually, I'm quite positive that it's rather unwieldy) but once I
get it working completely, I'll definitely post what I have come up
with. In the meantime, this is what I have now for the events category
(category-4.php)

---------------------------------
<?php get_header(); ?>
<div id="content">
<div class="post">
 <h3 class="storytitle"><?php single_cat_title(); ?></h3>
 <div class="meta"><?php  echo category_description(); 
// ejm June2006  http://wordpress.org/support/topic/51884 
 ?>
</div>

<ul>
 <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
        
<li><?php ec3_the_schedule(); ?><a href="<?php the_permalink()
?>"><?php the_title(); ?></a></li>
    
<?php endforeach; else: ?>
    
<li><?php _e('Sorry, no posts matched your criteria.'); ?></li>
 <?php endif; ?>
 </ul>
    <?php
    }else{ // give details or single post
    ?>

<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>

<?php the_date('','<h2>','</h2>'); ?>

<div class="post">
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php
the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php
the_title(); ?>"><?php the_title(); ?></a></h3>
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?>
&#8212; <?php the_author() ?> @ <?php date('H:i') ?> <acronym
title="<?php echo gmdate(T). strftime('%z', $t) . '">'. date(T);
?></acronym> <?php edit_post_link(); ?></div>

<div class="storycontent">
<?php
// ejm show all rather than excerpt
 the_content(); ?>
</div>

<div class="feedback">
<?php wp_link_pages(); ?>
<?php
// disable comments link if comments are disabled
 if ('open' == $post->comment_status) : ?>
<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'),
__('Comments (%)')); ?>
<?php endif;
// end of disabling comments link if comments are disabled
 ?>
</div>
<!--
<?php trackback_rdf(); ?>
-->
<?php comments_template(); ?>
</div>
<?php endforeach; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif;
} // ejm april2006 end if index or detail
?>

<p id="prevnxt"><?php posts_nav_link(' &#8212; ', __('&laquo; Previous
Page'), __('Next Page &raquo;')); ?></p>

</div>

<!-- end content -->
<!-- begin sidebar -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
---------------------------------

And this is how it looks: etherwork.net/blog/?cat=4
As opposed to other categories that look like this:
etherwork.net/blog/?cat=7

Here is the only difference between the two:
---------------------------------
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<small>(<?php the_date(); ?>)</small></li>
----------------------------------

-EMorris

On Fri Sep 1 11:50:22 UTC 2006, Alex Tingle wrote:
> Hi,
> 
> ejm wrote:
> > I am running WP2.0.4 with Event Calendar
> 3.1._pre11
> > 
> > On the event category page, I was hoping to show
> the title and date of
> > the event. Right now, it shows the title and date
> that the event was
> > posted.
> > 
> > Here is a link to the events category:
> etherwork.net/blog/?cat=4
> > The linked page shows titles of the various
> upcoming events. This
> > is the coding:
> > 
> > ------------------------------
> > <a href="<?php the_permalink() ?>"><?php
> the_title(); ?></a>
> > <small>(<?php the_date(); ?>)</small>
> > ---------------------------------------
> > 
> > that produces the following:
> > .......................
> > Title of the Event  (posted: Date that the Event
> was posted)
> > .......................
> 
> I suggest that you create a special Category
> template for your event category...
> 
>   http://codex.wordpress.org/Category_Templates
> 
> ..in order that you can change the appearance JUST
> of the event category. I think you are already doing
> this, but I thought I'd spell it out, so that
> everyone knows what you're up to.
> 
> Then put something like this into template's loop:
> 
>  <a href="<?php the_permalink() ?>"><?php
> the_title(); ?></a>
>  <small>(<?php ec3_the_schedule(); ?>)</small>
> 
> Let me know how you get on. If it works for you,
> could you post a copy of your category template so
> that other people can learn from it.
> 
> regards,
> 
> -Alex (Should be working today, but doing this
> instead!)
> 
> 
> --
> 
> On Fri, 01 Sep 2006 07:32:38 -0400
> ejm wrote:
> 
> > Please forgive me for bumping this into September
> and asking this once
> > again... I'll rephrase my question and
> > 
> > On Fri Sep 1 05:20:10 UTC 2006, Alex Tingle wrote:
> > >Perhaps I should change the list-welcome
> boilerplate to describe how to
> > >report a problem:
> > >
> > >  !!ALWAYS INCLUDE A URL!!
> > 
> > add a URL in hopes of getting a reply.
> > 
> > I am running WP2.0.4 with Event Calendar
> 3.1._pre11
> > 
> > On the event category page, I was hoping to show
> the title and date of
> > the event. Right now, it shows the title and date
> that the event was
> > posted.
> > 
> > Here is a link to the events category:
> etherwork.net/blog/?cat=4
> > The linked page shows titles of the various
> upcoming events. This
> > is the coding:
> > 
> > ------------------------------
> > <a href="<?php the_permalink() ?>"><?php
> the_title(); ?></a>
> > <small>(<?php the_date(); ?>)</small>
> > ---------------------------------------
> > 
> > that produces the following:
> > .......................
> > Title of the Event  (posted: Date that the Event
> was posted)
> > .......................
> > 
> > What I would like to display instead is the Title
> and Date of the
> > event as well as the date that the event was
> posted. (Actually, I'd
> > love to exclude the last part for the event
> category but have a very
> > tenuous grasp - ie: virtually none - of php
> coding). I'm guessing that
> > non-event category pages will ignore any php
> coding for the time
> > schedule and will simply show the title and the
> date for each post in
> > the non-event categories. 
> > 
> > How should I alter the following coding on my
> archive page to
> > achieve the desired effect?
> > 
> > .................................
> > <a href="<?php the_permalink() ?>"><?php
> the_title(); ?></a>
> > <small>- <?php NO_IDEA_WHAT_GOES_HERE(); ?> (<?php
> the_date();
> > ?>)</small>
> > ...........................
> > 
> > I guessed wrong with "ec3_get_schedule();" and
> "ec3_schedule();"
> > 
> > Please put me out of my misery. Thank you.
> > 
> > -EMorris
> > 
> > P.S. The real reason I would like to do this is
> for another wp that I
> > maintain that has many many events in the event
> category. (That
> > particular wp2.0.4 still uses eventcalendar 3.0.4)
> >
> -- 
> :: Let me solve your problems:
> http://www.firetree.net/consulting/
> :: alex.tingle AT firetree.net  +44-7901-552763 
> 
> _______________________________________________
> EventCalendar mailing list
> EventCalendar at firetree.net
> http://penguin.firetree.net/cgi-bin/mailman/listinfo/eventcalendar
> 




More information about the EventCalendar mailing list