public
Created

Add a year endpoint to WordPress categories.

  • Download Gist
category-endpoint.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php
/*
Plugin Name: Yearly Archives for Categories
Plugin URI: http://pmg.co/category/wordpress
Description: Adds an endpoint to categories for yearly archives.
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: Public Domain
*/
 
add_action( 'init', 'wpse31422_init' );
function wpse31422_init()
{
add_rewrite_endpoint( 'year', EP_CATEGORIES );
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.