2013-03-18 88 views
1

目前我有兩個自定義帖子類型說文章#1和文章#2。我也想爲每個帖子類型創建自定義標籤。我的意思是,如果我爲文章#1創建標籤,它將不會顯示在文章#2文章類型下。wordpress中每個帖子類型的自定義標籤

請幫我該怎麼做

回答

0

你可以做什麼是你的register_post_type添加一些在$ args參數其他項所謂的「分類」像

$args = array(
     'labels' => $labels, 
     'public' => true, 
     'publicly_queryable' => true, 
     'show_ui' => true, 
     'query_var' => true, 
     'rewrite' => true, 
     'capability_type' => 'post', 
     'hierarchical' => false, 
     'menu_position' => null, 
       'taxonomies' => array('tag') 
    ); 

希望這是你是什麼LO爲:) :)

0

有在崗標籤選項,後端則需要後面還有添加標籤,你必須呼籲前端,這些標籤可以使用函數此

<?php $posttags = get_the_tags(); 
        if ($posttags) { 
         echo get_the_tag_list('<ul><li>','</li><li>','</li></ul>'); 
        } 

    ?> 
相關問題