WordPress.org

Ready to get started?Download WordPress

Forums

404 error on pages after adding a custom post type (1 post)

  1. luismldias
    Member
    Posted 1 year ago #

    Hello,

    I am using a custom post type for a theme and the strange thing is that, the single-<post_type> template works perfecly but when i try to access a page i get a 404 error.

    I have rebuilt the permalinks and still get the error.

    There is no naming conflict with any page.

    The code i am using is the following:

    $args_video = array(
                'label' => 'Video',
                'labels' => $labels_video,
                'description' => 'videos',
                'public' => true,
                'exclude_from_search'=>true,
                'show_ui' => true,
                'show_in_menu'=>true,
                'map_meta_cap'=>true,
                '_edit_link' => 'post.php?post=%d',
                'capability_type' => 'post',
                'hierarchical' => false,
                'taxonomies' => array('raz_video'),
                'rewrite' => array("slug" => "raz_video"), // Permalinks format
                'supports' => array('title','page-attributes','thumbnail'),
                'has_archive' => true
            );
            $r = register_post_type('raz_video',$args_video );

    Has anyone had this issue before?

    Thanks in advance,

    Luis

Topic Closed

This topic has been closed to new replies.

About this Topic