Custom Post Type Archives – v1.4
So – this is another day when I announce new release for Custom Post Type Archives plugin – this time release is tagged with version 1.4. Won’t drag this and will just list all the new features.
Support for daily, monthly and yearly archives
Previously you couldn’t go to URL ‘http://example.com/post-type/photo/2010/09′ to list all the ‘photo’ post type posts from September in year 2010. Now you can. Note that you have to go to permalinks after you update the plugin to make this work. Sorry about that.
New function to utilize the previous feature
I’ve made a new function ‘wp_get_post_type_archives’ that works basically the same way as the ‘wp_get_archives’ function from WordPress. Actually it uses that function to get all the data and formatting. I only had to make this wrapper function to fix the links that link to these archives, because WordPress sadly didn’t have enough hooks in that function. This function has two parameters:
- $post_type – string with post type rewrite slug to whom do you want to get archives from. You can also supply ‘all’ as a value – that will return links to archives for ALL the custom post types. The only thing is – you have to make the homepage to include all the post types if you want this to work (to support ‘all’ value, rest will work perfectly).
- $args – the same arguments as you would pass to ‘wp_get_archives’ function.
To learn more please read the wp_get_archives functions documentation.
New body classes
I’ve also added new body classes for the custom post type archive pages – ‘post-type-archive’ and ‘post-type-{POST_TYPE}-archive’.
I hope that you won’t have any problems with this release but as always – if you have (or you have some suggestions) then let me know in comments.
Thanks.
Some say...
Interesting Design.
What can you say?