You have the rewrite
argument defined inside the $labels
array, move it out to the $args
array:
$args = array(
'labels' => $labels,
'hierarchical' => true,
'rewrite' => array('slug' => 'projects', 'with_front' => true)
);
Related Posts:
- Need help with add_rewrite_rule
- remove “index.php” from permalinks
- How do I add /blog/ as a prefix to permalink structure for blog posts, tag pages, etc.?
- Passing and retrieving query vars in wordpress
- Permalink format: singular or plural
- How does WordPress handle permalinks?
- Pretty permalinks for search results with extra query var
- How to get pretty URLs with add_query_arg in permalinks
- Creating custom permalink structure for languages
- Custom post type permalink endpoint
- How to remove dates from existing permalinks?
- Getting the Site URL Including the Front Base
- Using $_GET variables in the URL?
- Including category-base in a post permalink results in 404
- WordPress thinks my custom route is a 404
- Permalink with sub-sub-category and post name
- Custom Taxonomy in Permalink of Post
- Date based URLs for custom posts and pagination
- How to add a custom URL placeholder to author archives?
- How to custom change author base without $this->front?
- URL rewrite based on a custom field value
- Update URL Snippet to Canonical Permalink URL
- How to prevent the default home rewrite to a static page
- “.#[random-char-string]” being inserted at end of URLs
- How to change author base without front
- permastruct for custom post type not working in one of four cases
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Pretty Permalinks
- Make post slug have priority over category slug
- Custom taxonomy on permalink
- Remove parent slug for child pages
- How to create a permalink structure for posts in a specific category
- How to remove the index.php in the url?
- How to map permalinks with accented letters to sanitized slugs?
- Remove subfolders from URL
- Remove parent slug for child pages
- Add custom directory in URL
- Using two permalinks for one post
- flexible rewrite ‘ramble’ URLs with WordPress
- Include Taxonomy slug in post url
- How can I Rewrite a ‘page’ URL based on query string parameters?
- Custom rewrite rules for a $_GET request
- Nice RSS Feed URLs for each custom post type
- Change the custom post type permalink
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- custom naming of search permalink /search/
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Put post ID on the custom post type URL
- Rewrite url / permalink for default archive – yearly / monthly
- Rewrite user profile URL to be human friendly
- Remove Custom Taxonomy Slug from Permalink
- How to rewrite a folder in WordPress?
- How can I get .html URL suffixes in permalinks?
- Rewrite single template permalink?
- rewrites and custom links in page need help with add_rewrite_rule
- Category-dependent custom permalink
- Dynamically populate permalinks
- Converting WP Page to use full explicit paths?
- How to create an IIS7 re-write rule for a single category
- Prevent guessing slug
- All pages lead to home
- Folder Name and Category Name WordPress
- Once redirected by Rewrite rules, how can WordPress know the page?
- Although rewrite engine is on, I get 404 not found on every page
- Customized author slugs not working with get_author_posts_url method
- Remove index.php from WP 8.0 install migrated to IIS from Apache (still detecting Apache server)?
- Customize category permalinks
- WordPress permalink still not working (error or not understood?)
- Using a taxonomy value as part of a post URL
- Editing the variables in a custom URL
- ?posts_type=xxx not rewritten
- Update permalinks
- Losing the original URL when using add_rewrite_rule
- Custom Permalink Base
- Custom permalink variable on single post
- How to change pagination base from slash to query form?
- My wordpress site must be being affected by outside sources [duplicate]
- URL to an image in a post is changing when permalink is set to custom. Can I avoid this?
- region selection
- WordPress custom permalinks, pages are now 404
- How to shorten the Permalink after WP>WP blog import?
- Getting the terms from “Beautiful Taxonomy Filters” Results ot Integrate into “Ajax Load More”
- Include language variable in url
- how to create several url aliases for a page
- Permalinks, how to show them in post
- Single product link in woocomerce
- Creating complex URLs with WordPress permalink structure
- permalinks url with woocommerce
- How to get the perfect WordPress, WooCommerce, Custom Post Type pretty permalinks?
- URL issues with WordPress
- Blog url disappears
- Not recognizing my custom templates in hierarchy
- Add additional URL variations for a Post
- ‘Unsupported Operand Types’ error stemming from taxonomy re-writes with PHP 8.1
- Using a variable in page permalink
- How to make my custom permalink pull up the correct post
- Blog URL Structure – Multiple Taxonomies
- Custom post permalinks for specific categories
- Best way to approach creating a sitemap with unique URLS (No Permalink Changes)
- Display the content of another page from a specific URL