Skip to content

Instantly share code, notes, and snippets.

@dryan1144
Created July 13, 2017 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dryan1144/65ca551d037b08911ad487a3cf7033cb to your computer and use it in GitHub Desktop.
Save dryan1144/65ca551d037b08911ad487a3cf7033cb to your computer and use it in GitHub Desktop.
<?php
function hck_rewrite_post_types() {
add_rewrite_rule('^articles/([^/]*)/?','index.php?post_type=articles&topics=$matches[1]','top');
add_rewrite_rule('^questions/([^/]*)/?','index.php?post_type=questions&topics=$matches[1]','top');
add_rewrite_rule('^amas/([^/]*)/?','index.php?post_type=amas&topics=$matches[1]','top');
}
add_action( 'init', 'hck_rewrite_post_types');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment