日韩伦理亚洲欧美在线一区_免费看一级大片_在线观看视频一区二区_日韩大片高清播放器大全






    當網(wǎng)站有多個類型內(nèi)容的時候,可能需要用到Custom Post Type UI這個插件來分出幾個post type,但是如果想要在自定義的post type的文章內(nèi)容里面添加tag就需要做一下操作:

    1、首先確保已安裝 Custom Post Type UI插件

    2、安裝完插件以后進入后臺CPT UI —->Import/Export,在打開的頁面里面找到Get Code標簽,找到對應的post type代碼復制,然后放在主題目錄下面的functions.php文件下面

    3、 對已復制的代碼進行修改:

    add_action( 'init', 'cptui_register_my_cpts_application' );
    function cptui_register_my_cpts_application() {
    	$labels = array(
    		"name" => "Applications",
    		"singular_name" => "Application",
    		);
    
    	$args = array(
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"show_ui" => true,
    		"show_in_rest" => true,
    		"has_archive" => true,
    		"show_in_menu" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => true,
    		"rewrite" => array( "slug" => "application", "with_front" => true ),
    		"query_var" => true,
    
    		"supports" => array( "title", "editor", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "thumbnail", "author", "page-attributes", "post-formats" ),		
    		"taxonomies" => array( "application-category" ),		
    	);
    	register_post_type( "application", $args );
    
    // End of cptui_register_my_cpts_application()
    }

    替換成一下代碼:

    add_action( 'init', 'wpsites_custom_post_type' );
    function wpsites_custom_post_type() {
    
    register_post_type( 'application',
        array(
            'labels' => array(
                'name'          => __( 'Applications', 'wpsites' ),
                'singular_name' => __( 'Application', 'wpsites' ),
            ),
            'has_archive'  => true,
            'hierarchical' => true,
            'menu_icon'    => 'dashicons-heart',
            'public'       => true,
            'rewrite'      => array( 'slug' => 'application', 'with_front' => false ),
            'supports'     => array( "title", "editor", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "thumbnail", "author", "page-attributes", "post-formats" ),
            'taxonomies'   => array( 'application',  'post_tag' ),
        ));
    
    }

     

    ? ? ? ? ? ? ? ? ? ? ? ?

    我們將在一個工作日內(nèi)聯(lián)系您

    ? ? ? ? ? ? ? ? ? ? ? ?

    免費診斷您的獨立站及產(chǎn)品搜索量,制定您的海外營銷計劃

    江山市| 舞阳县| 金堂县| 朔州市| 鲁甸县| 塔河县| 滦平县| 德州市| 团风县| 青神县| 新巴尔虎左旗| 江孜县| 龙里县| 郴州市| 明水县| 棋牌| 清新县| 都昌县| 浦城县| 孙吴县| 新干县| 靖西县| 马关县| 东丽区| 萨嘎县| 开阳县| 伊宁县| 嘉黎县| 汕尾市| 神池县| 洛南县| 榕江县| 信丰县| 武宁县| 光山县| 海林市| 崇文区| 玉门市| 龙州县| 汾西县| 河南省|