我有aj-fashions自定义帖子类型。从技术上说,我试图在名为fashio-template.php的模板文件中显示所有帖子的循环,现在为单个帖子创建了文件single-fashions.php。仍然我正在404页面找不到错误。自定义帖子类型单页不起作用
请注意,以下是我的代码。
add_action('init', 'fashion');
function fashion() {
register_post_type('aj-fashion',
array(
'labels' => array(
'name' => __('AJ Fasions'),
'singular_name' => __('AJ Fashion')
),
'public' => true,
'has_archive' => true,
'show_ui' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'aj-fashions',),
'supports'=> array('title', 'editor', 'thumbnail', 'author'),
)
);
}
adding flush_rewrite_rules();工作。 –
什么是单个帖子特定的帖子循环? –
从设置更新固定链接。 –