Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2011 16:56
Show Gist options
  • Save anonymous/1107220 to your computer and use it in GitHub Desktop.
Save anonymous/1107220 to your computer and use it in GitHub Desktop.
functions.php
add_action( 'init', 'event_rewrites' );
function event_rewrites()
{
add_rewrite_rule( 'events/day/(\d{4}-\d{2}-\d{2})/', 'index.php?post_type=event&event-date=$matches[1]', 'top' );
}
add_filter( 'query_vars', 'event_vars' );
function event_vars ( $vars )
{
$vars[] = 'event-date';
return $vars;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment