UPDATED!
I am developing a theme for WordPress by following some tutorials. The main page works well, loading post of a custom post type, and the page to see the contents of the cpt also following the Wordpress nomenclature: single-{name-cpt}.php.
The problem is when I create a normal page. When entering the URL of the page, the error page appears 404.php.
I have refreshed the link structure and verified that the .htaccess is correct.
What could be happening so that it does not load page.php?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Custom links structure: /blog/%postname%/
UPDATED!
Function code to create cpt:
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'videos_porno',
array(
'labels' => array(
'name' => __( 'Videos porno' ),
'singular_name' => __( 'Video porno' )
),
'public' => true,
'has_archive' => false, //true
'hierarchical' => false,
'rewrite' => array('slug' => '', 'with_front' => false),
'register_meta_box_cb' => 'add_metaboxes_video_porno',
'supports' => array( 'title', 'editor', 'thumbnail' )
)
);
$args= array(
'label' => 'Servidores',
'hierarchical' => false,
'rewrite' => false,
);
register_taxonomy( 'servidores', 'videos_porno', $args );
}
function my_rewrite_flush() {
create_post_type();
flush_rewrite_rules();
}
add_action( 'after_switch_theme', 'my_rewrite_flush' );
Before implementing the code that the cpt adds, everything works correctly.
With the link structure /blog/%postname%, Is it possible that cpt posts and pages share the directory "/" for urls?