Skip to content

Instantly share code, notes, and snippets.

@beaucollins
Forked from anonymous/gist:1107220
Created July 26, 2011 17:17
Show Gist options
  • Save beaucollins/1107264 to your computer and use it in GitHub Desktop.
Save beaucollins/1107264 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