Skip to content

Instantly share code, notes, and snippets.

@alenabdula
Created February 1, 2016 15:46
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 alenabdula/11966d7600ca27ab96c9 to your computer and use it in GitHub Desktop.
Save alenabdula/11966d7600ca27ab96c9 to your computer and use it in GitHub Desktop.
WordPress Custom Post Type & Taxonomy rewrite notes
<?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