Works perfect on localhost, not in live version
-
Hi, thanks for the time you put into create and support this plugin!
I have it working perfectly on my localhost but when i export the website using “All-in-One WP Migration” to a live site, everything works except for my single cpt page, that returns a 404.
Prefered url structure: domain-name.com/portfolio/branche/post-name
Here is how i registered my custom post type:
function cptui_register_my_cpts() { /** * Post Type: Portfolio. */ $labels = [All my labels....]; $args = [ "label" => __( "Portfolio", "kroeze-interieur" ), "labels" => $labels, "description" => "", "public" => true, "publicly_queryable" => true, "show_ui" => true, "show_in_rest" => true, "rest_base" => "", "rest_controller_class" => "WP_REST_Posts_Controller", "has_archive" => true, "show_in_menu" => true, "show_in_nav_menus" => true, "delete_with_user" => false, "exclude_from_search" => false, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => true, "rewrite" => array( 'with_front' => true ), "query_var" => true, "menu_icon" => "dashicons-visibility", "supports" => [ "title", "thumbnail" ], "taxonomies" => [ "branches" ], "show_in_graphql" => false, ]; register_post_type( "portfolio", $args ); } add_action( 'init', 'cptui_register_my_cpts' );
And here is how i registered my custom taxonomy:
function cptui_register_my_taxes() { /** * Taxonomy: Branches. */ $labels = [My labels...]; $args = [ "label" => __( "Branches", "kroeze-interieur" ), "labels" => $labels, "public" => true, "publicly_queryable" => true, "hierarchical" => true, "show_ui" => true, "show_in_menu" => true, "show_in_nav_menus" => true, "query_var" => true, "rewrite" => array( 'slug' => 'portfolio', 'with_front' => true ), "show_admin_column" => true, "show_in_rest" => true, "show_tagcloud" => false, "rest_base" => "branches", "rest_controller_class" => "WP_REST_Terms_Controller", "show_in_quick_edit" => false, "show_in_graphql" => false, ]; register_taxonomy( "branches", [ "portfolio" ], $args ); } add_action( 'init', 'cptui_register_my_taxes' );
As i mentioned it works perfectly on my localhost using Local by Flywheel, am i missing something? Or is it the ip number i use on the temporary live link?
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Works perfect on localhost, not in live version’ is closed to new replies.