Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Created October 18, 2011 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisguitarguy/1296860 to your computer and use it in GitHub Desktop.
Save chrisguitarguy/1296860 to your computer and use it in GitHub Desktop.
Add a year endpoint to WordPress categories.
<?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 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment