with your code you completely redefine your CPT instead of just modifying the slug
maybe this change the public access
try this :
$args = get_post_type_object("portfolio");
$args->rewrite["slug"] = "homepage";
register_post_type($args->name, $args);
Related Posts:
- Custom Post type & Taxonomy URL structure
- Slug Formatting : Acceptable Characters?
- Disable permalink on custom post type
- Combining Multiple Taxonomies in one URL
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- How to achieve this permalink -> category-name/custom-post-type-name/post-name
- Prepend meta_value to permalink of post
- Remove Slug from Custom Post Type results in 404
- Remove taxonomy slug when not assigning taxonomy with custom post types
- Can’t edit Custom Post Type slug/permalink
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Taxonomy breaking pages permalinks
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Automaticly add slug to posts
- How do I fix permalinks for custom post types that has the same slug as a page?
- Why does wordpress keep adding postname to my CPT’s permalink in the end?
- Wrong generated page_name/slug on first publish of custom post type
- Remove post type slug of all post types from permalinks
- Stop / prevent WordPress from updating permalinks of custom post type
- Rewrite post type slug only for child theme
- Child post with numeric only slug keeps redirecting to parent
- Permalink for a custom post type isn’t working and I don’t know why
- Assign same parrent Page to pages AND custom post types
- Create a custom php page and load it at a specific slug
- Custom Post Type – Duplicate Page Slugs
- Remove permalink for custom post type
- How do you create %post_type%/%postname%/ permalink structure?
- Custom Post Type Advanced Slug
- Changing CPT slug and taxonomy already registered in parent theme
- Custom Post Type to replace Woocommerce products – page not found error
- Need to return a string as permalink insted of str_replace
- Under What Conditions Can I name my CPT the same as my CPT Page?
- Change permalink incrementor into pseudo-subdirectory
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Two CPT: one is using part of the custom rewrite slug from the other
- WordPress page not showing up – replaced with last 10 posts?
- Custom permalink rewrite rules – how do I fix this?
- Can I override the permalink/slug on creation
- Get full control over custom post type url
- Add category slug as class attribute in a link array
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Can’t make permalink of CPT work
- How to make nested custom post type slugs work
- Hide custom post type slug url from search engine [closed]
- Custom post type Premalinks main page and details page
- How to change permalink structure off default posts and also CPT’s posts
- How to get taxonomy category in permalink for each taxonomy OR How to give a parent page to a given taxonomy?
- Programmatically rewriting slug through functions.php but returns 404
- URL rewrite add author as base
- Custom Post Type with Same Page URL
- Remove CPT name from permalink but add %category% instead
- Permalinks /country/city/cpt/postname/
- Custom Permalink to remove category word , keeping posts permalink with date?
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- Seamless permalinks between Custom Taxonomy and Custom Posts
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- Need help with permalink rewrites for Custom Post Types with hierarchical relationships
- Custom Post Type Permalink empty
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Change custom post type permalink to show name of post from another custom post type?
- Custom Post Type Permalink
- How to prevent a CPT’s slug and page slug from conflicting with each other?
- Permalinks for custom post type
- Custom Post Slug same as Parents Category Slug
- How to have this permalink structure: post_type/postname/custom_inner_page
- Additional section in custom post type permalink
- Multiple (two) category postings on the same page.
- How to include term custom meta into the custom taxonomy term permalink structure
- Blog posts for custom post type only
- Path to custom post type
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Custom taxonomy returns 404
- Removed custom post type slug but not working for child pages
- Including taxonomy term before post type breaks top level pages
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Permalinks: custom post type -> custom taxonomy -> post
- Custom post type archive pagination 404
- CPT’s with landing page instead of archive – Url Rewrite?
- How to change permalink to include custom post type
- Removing Custom Permalink Structure for Custom Post Type
- Custom post type, permalinks, taxonomies and blog posts
- Custom post type permalink tag 404
- Custom post type permalink returns 404
- Use the same date-based permalink structure for all post types
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- permalink /category/post-name with custom post type and taxonomy
- “Post name” permalink returns home page for custom posts
- Custom post type and taxonomy permalinks
- Hierarchical permalinks for custom post type and taxonomy
- How to organize hierarchical structure in custom post type with taxonomy (like with categories)
- Make custom post types and pages place nice, re: rewrite
- Custom Post Fields at the beginning of a Custom Permalink
- Can slugs from posts and custom post types conflict?
- Flush Rewrite Rules when new site is created on network
- Pretty URLs and custom post types
- Form action doesn’t work if slug isn’t same as custom post title
- How to make permalink structure %category%/%postname%/ work for custom post type?
- set permalink for CPT
- Ignoring slug capitalization on rewrite rule for custom post type archive page