• Resolved Marco77

    (@marcokiel77)


    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?

    • This topic was modified 3 years, 1 month ago by Marco77.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hello @marcokiel77,

    Thanks for your message.

    If you import settings, you also import settings saved by the plugin, including old URLs.

    I have a suggestion. Disable and uninstall the plugin, then re-install and set it again. Did that fix the problem?

    Best,
    Mateusz

    Thread Starter Marco77

    (@marcokiel77)

    Hi,

    No unfortunately, i did not work..

    Thread Starter Marco77

    (@marcokiel77)

    I can share a live link to show that it works on my localhost if you prefer

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @marcokiel77 I believe. It seems a bit weird if it’s the same website.

    Perhaps this has to do with the tilde character (~) in the URL. There are regexes generated in PHP and this sign can cause problems.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Works perfect on localhost, not in live version’ is closed to new replies.