Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.