Skip to content

Instantly share code, notes, and snippets.

@shawnhooper
Created July 17, 2014 14:32
Show Gist options
  • Save shawnhooper/a97ce0ec151a5a38822d to your computer and use it in GitHub Desktop.
Save shawnhooper/a97ce0ec151a5a38822d to your computer and use it in GitHub Desktop.
add_rewrite_rule('^workshops/([^/]+)(/[0-9]+)?/([^/]+)/([^/]+)', 'index.php?&workshop=$matches[4]&page=', 'top');
add_rewrite_rule('^workshops/([^/]+)(/[0-9]+)?/([^/]+)', 'index.php?pagename=workshops&cat=$matches[1]&subcat=$matches[3]', 'top');
add_rewrite_rule('^workshops/([^/]+)/?', 'index.php?pagename=workshops&cat=$matches[1]', 'top');
add_rewrite_tag('%subcat%', '([^&]+)');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment