我们的自定义帖子类型帖子的源代码中有一个额外的提要:
www.example/post-type/post/feed/
我想删除多余的
/feed/
从我们的CPT生成404。
从register_post_type 函数引用,我已尝试添加\'rewrite\' => array(\'feeds\' => false),
收件人:
register_post_type(\'templates\',
array(
\'labels\' => array(
\'name\' => __( \'Templates\' ),
\'singular_name\' => __( \'Template\' ),
\'add_new\' => __( \'Add New\' ),
\'add_new_item\' => __( \'Add New Template\' ),
\'edit\' => __( \'Edit\' ),
\'edit_item\' => __( \'Edit Template\' ),
\'new_item\' => __( \'New Template\' ),
\'view\' => __( \'View Template\' ),
\'view_item\' => __( \'View Template\' ),
\'search_items\' => __( \'Search Templates\' ),
\'not_found\' => __( \'No Templates found\' ),
\'not_found_in_trash\' => __( \'No Templates found in Trash\' ),
\'parent\' => __( \'Parent Templates\' ),
),
\'public\' => true,
\'show_ui\' => true,
\'exclude_from_search\' => true,
\'hierarchical\' => true,
\'supports\' => array( \'title\', \'editor\', \'thumbnail\',\'page-attributes\' ),
\'rewrite\' => array(\'feeds\' => false),
\'query_var\' => true
)
);
}
但这并没有解决问题。
感谢您的帮助。