Skip to content

Instantly share code, notes, and snippets.

@rahularyan
Last active August 29, 2015 14:26
Show Gist options
  • Save rahularyan/c60868fbed0b696b7119 to your computer and use it in GitHub Desktop.
Save rahularyan/c60868fbed0b696b7119 to your computer and use it in GitHub Desktop.
<?php
/**
* This filter will override AnsPress rewrite rule
* @param array $rules
**/
function my_custom_ap_rewrite($rules){
global $wp_rewrite;
$base_page_id = ap_opt('base_page');
$rules["categories/?$"] = "index.php?page_id=".$base_page_id."&ap_page=categories";
$rules["tags/?$"] = "index.php?page_id=".$base_page_id."&ap_page=tags";
return $rules;
}
add_filter('ap_rewrite_rules', 'my_custom_ap_rewrite' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment