Aşağıda custom post type oluşturdum ama tekil görüntüleme sayfasında sayfa bulunamadı deyip 404 veriyor local de olduğum için olabilir mi? Sorun çünkü daha önce de hep bu şekilde kullanıyordum. Çalışıyordu veya hata yaptıysam da göremedim bir türlü.
function ekokitapistek() {
register_post_type( 'kitap-istek',
array(
'labels' => array(
'name' => __( 'EKO İstekler' ),
'singular_name' => __('EKO İstek'),
),
'menu_icon' => 'dashicons-admin-tools',
'public' => true,
'hierarchical' => true,
'has_archive' => true,
'rewrite' => array( 'slug' => 'kitap-istek' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail' ),
'taxonomies' => array(
'post_tag',
'category',
'genre',
'writer',
)
)
);
}

add_action( 'init', 'ekokitapistek' );

add_action( 'pre_get_posts', 'post_tipini_sorguya_ekle' );

function post_tipini_sorguya_ekle( $query ) {
if ( is_home() && $query->is_main_query() )
$query->set( 'post_type', array( 'post','kitap-istek' ) );
return $query;
}

add_filter( 'single_template', 'eko_single_kitap_istek' );
function eko_single_kitap_istek( $single_template ){
global $post;

$file = get_template_directory() .'single-'. $post->post_type .'.php';

if( file_exists( $file ) ) $single_template = $file;

return $single_template;
}

add_theme_support( 'post-thumbnails', array('post','kitap-istek') );