[wp-trac] [WordPress Trac] #4414: Patch to Make Calendars Optionally Category-Specific

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 6 04:40:54 GMT 2007


#4414: Patch to Make Calendars Optionally Category-Specific
-------------------------+--------------------------------------------------
 Reporter:  jacobrose    |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  low          |   Milestone:           
Component:  Template     |     Version:  2.2      
 Severity:  trivial      |    Keywords:           
-------------------------+--------------------------------------------------
 First submission to wordpress...the nice people on wp-hackers directed me
 here. Here's my post to the list, explaining what this is:

 I'm new to WordPress and building a custom template for my new personal
 site. My design calls for a calendar that stays within a given category,
 and I couldn't find a way to do that; using "get_calendar()" on my
 category archive page returned a calendar with all posts in it, therefore
 providing navigation to pages outside the selected category (which didn't
 work out).

 I have patches to the get_category, get_month_link, and get_day_link
 functions that let you have in-category calendars (see attached diffs for
 wp-includes/general-template.php and wp-includes/link-template.php). You
 can use the modified calendar on the archive page like so:

 $cat = array_shift( get_the_category() );
 get_calendar( true, $cat->cat_ID );

 I'm not sure if that's the canonical way to find the archive page's
 category id (I kinda doubt it), but it works.

 I don't have any other contributors to my site planned, but it wouldn't be
 hard to make the calendar glue itself to the author in the same way...but
 is there a standard WordPressian way to accomplish this without
 modifications like these?

 Thanks for any feedback and thanks for WordPress!

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4414>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list