Created
February 1, 2016 15:46
-
-
Save alenabdula/11966d7600ca27ab96c9 to your computer and use it in GitHub Desktop.
WordPress Custom Post Type & Taxonomy rewrite notes
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 | |
/** | |
* WordPress Custom Post Type & Taxonomy rewrite notes: | |
* When creating CPT/Tax always rewrite the slug and make sure 'with_front' is set to false | |
* In the rewrite section add following | |
*/ | |
$args = array( | |
'rewrite' => array( | |
'slug' => 'SLUG', # Used as pretty permalink text (i.e. /tag/) - defaults to $taxonomy (taxonomy's name slug) | |
'with_front' => false, # allowing permalinks to be prepended with front base - defaults to true | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment