Created
March 9, 2016 00:05
-
-
Save diegoliv/09d1b22ea8aa9a6ad83f to your computer and use it in GitHub Desktop.
Rewrite Rules issue - how to make both work?
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
<?php | |
function rewrite_rules(){ | |
add_rewrite_tag( '%course%', '([^&]+)' ); | |
add_rewrite_tag( '%theme%', '([^&]+)' ); | |
add_rewrite_rule("^app/course/([^/]+)/?",'index.php?page_id=3400&course=matches[1]', 'top' ); | |
add_rewrite_rule('^app/course/([^/]+)/theme/([^/]+)/?','index.php?page_id=3400&course=$matches[1]&theme=$matches[2]', 'top' ); | |
} | |
add_action( 'init', 'rewrite_rules' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment