I'm trying to create clean url's for my custom post type, but I can't seem to figure out how to make this work.
First I followed the Wordpress codex using publicly_queryable
and query_var
in my public function register_post_type
: http://codex.wordpress.org/Function_Reference/register_post_type
I also found this stackexchange topic, I've added the classes but I couldn't make it work: Clean URL permalink for custom post type
I'm using the following code to register my custom post type:
register_post_type('team' , array(
'labels' => $labels,
'public' => true,
'has_archive' => false,
'menu_position' => 5,
'menu_icon' => get_stylesheet_directory_uri(). '/teamProfiles/team-icon.png',
'supports' => array('title', 'editor', 'thumbnail'),
'rewrite' => false
));
As mentioned above I've tried adding some values from the codex as below:
'rewrite' => array('slug' => 'team'),
'query_var' => 'team',
'publicly_queryable' => true
Maybe a note, I've build my custom post type in as a PHP class. Hope someone can help me out.