views:

19

answers:

2

i'm starting with wordpress (from a drupal background) and trying to figure out how to create a new "menu" or url pattern. not quite sure what the lingo is in wordpress so im having a little trouble searching online for it.

the current archive allows you to sort by: /post/date/2010/06

what i'm trying to do is extend the archive functionality to include a "day" as well. ie. /post/date/2010/06/22

i dont mind creating a new page type for this purpose such as /archive/YYYY/MM/DD or something like that.

not sure where to begin with matching the "url pattern" to the "url handler" function or template.

A: 

Wordpress can customize the style of permalinks you use on the Settings/Permalinks tab of your administrative page. It sounds like you want something like /%year%/%monthnum%/%day%/%postname%, which should allow you to group by year, year/month, and year/month/date.

Craig Trader
I've done something like that but I needed to customise the filtering by category somehow.Sorry I didn't mention earlier that I wanted to display the archive in 2 chunks. The first being posts in CategoryA and the second chunk with all posts NOT in CategoryA.I have it working now by overriding the archive.php and customising the $wp_query object a little, although I feel that its a little wasteful because it already makes a db call prior to this. So all up, 3 calls to the db instead of 1.
twig
A: 

I ended up using:

<ul><?php wp_get_archives('type=daily'); ?></ul>

It gave me an archival list of links which point directly to the pages I needed. The archive already supported filtering by day, so I just needed to find a way to access it.

The url pattern is /post/yyyy/mm/dd

If anyone is interested in generating a link directly to that page, use:

<?php echo get_day_link(2010, 6, 20); ?>
twig