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
- Permalinks: custom post type -> custom taxonomy -> post
- Mixing custom post type and taxonomy rewrite structures?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Change permalinks for posts but not for custom post types
- Custom post type permalink: only use %post_id% and remove %postname%
- Having a custom post slug that clashes with an existing directory
- Help with a TV series Rewrite structure
- post_type_link filter causes 404 on the CPT page it’s used on
- Pretty paged permalinks in custom post type loop
- single-type.php not working, delivering 404
- How to create a permalink for custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- WP query by custom post type slug/name
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- After updating a page, all pages on the site used the index.php template
- Parent & Child Taxonomy slugs in custom post permalink
- Custom Post Types and independent Categories – complex Taxonomy
- Append date to custom post type url slug
- Use menus with anchors
- Permalink structure by Post Meta value
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- Permalinks /country/city/cpt/postname/
- 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
- Path to custom post type
- Make custom post types and pages place nice, re: rewrite
- set permalink for CPT
- Auto Slug Generation for Custom Post type
- Permalink problems with custom post type and custom taxonomy
- WordPress different templates for same type custom post (but different slug)
- Route subpage to Custom Post Type
- How to remove /blog/ prefix for custom post types in permalinks?
- On saving Post My permalink is updated and category is removed automatically which cause the 404
- Category permalinks don’t work even after flushing
- Changing permalink of default Post with custom post
- Custom Taxonomy Archive generates 404
- Enabling hierarchical in a Custom Post Type gives error 404
- Standard Page Child of CPT Not Found (404)
- add .html to custom post type with WPML
- How to create a permalink structure with custom taxonomies and custom post types
- Permalinks change when edit published post on custom post type
- How to retrieve custom post type permalink in another cpt?
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Same permalink structure for all post types?
- Custom post type with parent page? Possible?
- Hierarchical taxonomy in permalink structure
- Cannot modify a registered custom post type rewrite slug
- “regular” pages not found after changing permalink
- Custom Post Type and Taxonomy pagination permalink
- Custom post type permalink structure
- How do I use CPT and permalinks with a mobile theme?
- Can I have a specific template for products even if they are standard posts and not CPT?
- Add post id to url instead of WordPress default -2 suffix
- Taxonomy Archive URL + Template