Created
July 2, 2012 19:20
-
-
Save micahwave/3035095 to your computer and use it in GitHub Desktop.
rewrite rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // make it so we can use /photo/x/ with galleries | |
| function time_rewrite_rules() { | |
| global $wp_rewrite; | |
| add_rewrite_tag( '%photo%', '([^&]+)' ); | |
| add_rewrite_tag( '%slide%', '([^&]+)' ); | |
| add_rewrite_tag( '%tab%', '([^&]+)' ); | |
| add_rewrite_endpoint('photo', EP_PERMALINK); | |
| add_rewrite_endpoint('video', EP_PERMALINK); | |
| add_rewrite_endpoint('slide', EP_PERMALINK); | |
| add_rewrite_rule( '^contributors/(.+?)/page/([0-9]{1,})/?$', 'index.php?pagename=contributors&tab=$matches[1]&paged=$matches[2]', top ); | |
| add_rewrite_rule( '^contributors/([^/]*)/?', 'index.php?pagename=contributors&tab=$matches[1]', top ); | |
| $wp_rewrite->flush_rules(); | |
| } | |
| add_action('init', 'time_rewrite_rules', 999); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment