我没有发现任何类似的问题:实际上,分类法问题通常与标准的“自定义帖子+自定义类别”模型有关。 我想要的是获得一个特定的分类法URL,该URL具有主要的WP类别“共享”自定义帖子。 原因是我希望我的用户一起管理所有类别。 这是我的代码:
obj.labourCharge(4.0);
它工作正常。我也有一个自定义帖子模板。 单个证明书实体的详细数据页面已按以下方式正确加载:
obj.getlabourCharge(double);
但是类别和归档的永久文本不起作用。
致电类别:
if(!function_exists('testimonial_post')):
function testimonial_post(){
$labels = array(
'name' => esc_html__( 'Testimonial','Testimonial' ),'singular_name' => esc_html__( 'Testimonial','menu_name' => esc_html__( 'Testimonial' ),'parent_item_colon' => esc_html__( 'Parent Testimonial' ),'all_items' => esc_html__( 'All Testimonial' ),'view_item' => esc_html__( 'View Testimonial' ),'add_new_item' => esc_html__( 'Add New Testimonial' ),'add_new' => esc_html__( 'New Testimonial' ),'edit_item' => esc_html__( 'Edit Testimonial' ),'update_item' => esc_html__( 'Update Testimonial' ),'search_items' => esc_html__( 'Search Testimonial' ),'not_found' => esc_html__( 'No article found' ),'not_found_in_trash' => esc_html__( 'No article found in Trash' )
);
$args = array(
'labels' => $labels,'public' => true,'publicly_queryable' => true,'show_in_menu' => true,'show_in_admin_bar' => true,'can_export' => true,'has_archive' => false,'hierarchical' => false,'menu_icon' => 'dashicons-format-quote','supports' => array( 'title','editor','thumbnail','excerpt'),'taxonomies' => array( 'category' )
);
register_post_type('testimonial',$args);
}
add_action('init','testimonial_post');
endif;
没有结果 (其中“ allievi”是分配给个人鉴定的主要类别,因此...此类别中没有帖子,但是有许多个人鉴定自定义类型。)
调用自定义帖子存档:
mysite.it/testimonial/john-rossi/
(未找到)
我想获取类别和自定义帖子的特定网址,并将我的自定义帖子保留在主要WP类别分类法中。 像
mysite.it/category/allievi/
以获取完整列表。
mysite.it/testimonial/
对于特定类别>子类别列表。
有可能吗?
谢谢!