Tuesday, February 5, 2019

WP custom page type but problem page not found

I create a custom post type to see this article link given.

https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/

use this code:

// Our custom post type function
function create_posttype() {
    register_post_type( 'movies',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Movies' ),
                'singular_name' => __( 'Movie' )
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'movies'),
        )
    );
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );



but the problem is when i add a article and click the peralink it show page not found.


solve this to go setting->permalink then check Post Name.



No comments:

Post a Comment