• Resolved profango

    (@profango)


    I’ve been using the plugin for a few hours. It seemed to be going well until after a few times of trying to “Preview” the post it’s sending me to a 404 redirect or saying the page cannot be found.

    I disabled all of the plugins and I still got the same results.

    What can I do to fix this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Have you flushed your permalink rules, just as an extra step to figure out what’s going on? Do the single posts work with permalinks turned off?

    Hi

    I have the same issue and yes permalinks (https://mydomaine.com/%postname%) rules flushed.

    Here is my CPT:

    function cptui_register_my_cpts_adresse() {
    
    	/**
    	 * Post Type: Adresses.
    	 */
    
    	$labels = array(
    		"name" => __( 'Adresses', '' ),
    		"singular_name" => __( 'Adresse', '' ),
    	);
    
    	$args = array(
    		"label" => __( 'Adresses', '' ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"show_in_rest" => false,
    		"rest_base" => "",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "adresse", "with_front" => true ),
    		"query_var" => true,
    		"menu_icon" => "dashicons-admin-users",
    		"supports" => array( "title", "editor", "thumbnail", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "author", "page-attributes", "post-formats" ),
    		"taxonomies" => array( "category" ),
    	);
    
    	register_post_type( "adresse", $args );
    }
    
    add_action( 'init', 'cptui_register_my_cpts_adresse' );

    Googled my issue and find the answer here: https://stackoverflow.com/questions/19552409/wordpress-preview-broken-on-custom-post-types

    In short remove “post-formats” from the support:
    "supports" => array( "title", "editor", "thumbnail", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "author", "page-attributes", "post-formats>" ),

    • This reply was modified 7 years, 9 months ago by pako69.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Odd, but whatever works, I guess ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Preview not working on Custom Post Type’ is closed to new replies.