Make WordPress Core

Opened 19 years ago

Closed 11 years ago

#4414 closed enhancement (maybelater)

Patch to Make Calendars Optionally Category-Specific

Reported by: jacobrose Owned by:
Priority: normal Milestone:
Component: Posts, Post Types Version: 2.2
Severity: normal Keywords: needs-patch
Cc: Focuses: template

Description

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!

Attachments (2)

general-template.diff​ (2.5 KB ) - added by jacobrose 19 years ago.
link-template.diff​ (1.5 KB ) - added by jacobrose 19 years ago.

Download all attachments as: .zip

Change History (11)

#1 @Speedboxer
19 years ago

  • Keywords get_calendar template calendar added
  • Milestone → 2.3 (trunk)

#2 @foolswisdom
19 years ago

  • Keywords has-patch added

#3 @westi
19 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone 2.3 → 2.4 (next)
  • Owner changed from anonymous to westi
  • Status new → assigned

This sounds like an interesting feature.

It maybe plugin material but if the changes to core are minimal to support calendars that follow the current cat/author for the relavent archive pages then it is probably useful

The template tag should be able to detect the cat/author automatically though.

Maybe we need get_calendar varient - get_archive_calendar that gives you the relavent calendar for the type of archive being displayed - post (same as current) / cat / author (both get limited calendars).

Template authors could then use those.

Push this enhancement to 2.4 and adding needs-patch as current patches do not apply.

#4 @westi
19 years ago

  • Severity trivial → normal

This is next of my todo list.

#5 @westi
19 years ago

  • Milestone 2.5 → 2.6

Move to 2.6 as I haven't got anywhere with completing this yet :-(

#6 @Denis-de-Bernardy
17 years ago

  • Keywords get_calendar, template, calendar, needs-patch → needs-patch get_calendar, template, calendar
  • Milestone 2.9 → Future Release

#7 @westi
15 years ago

  • Keywords needs-patch get_calendar, template, calendar → needs-patch get_calendar template, calendar
  • Owner westi removed
  • Status accepted → assigned

I never got to doing this, it would be a nice thing to have but isn't high priority.

#8 @nacin
13 years ago

  • Component Template → Posts, Post Types
  • Focuses template added

#9 @chriscct7
11 years ago

  • Keywords get_calendar template calendar removed
  • Milestone Future Release
  • Priority low → normal
  • Resolution → maybelater
  • Status assigned → closed

Closing as maybelater. Complete lack of interest on the feature on the ticket over the last 8 years. Feel free to reopen when more interest re-emerges (particularly if there's a patch)

Note: See TracTickets for help on using tickets.