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






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

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

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

    3、 對已復(fù)制的代碼進(jìn)行修改:

    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)品搜索量,制定您的海外營銷計劃

    奈曼旗| 同江市| 驻马店市| 嘉兴市| 改则县| 绥芬河市| 芒康县| 青州市| 岫岩| 开平市| 梓潼县| 株洲市| 喀喇沁旗| 江津市| 武胜县| 西乡县| 阳东县| 铜梁县| 腾冲县| 扶余县| 广东省| 江北区| 莱州市| 平陆县| 和顺县| 北安市| 莱西市| 乐平市| 朝阳县| 封开县| 元氏县| 绥江县| 沅陵县| 尚志市| 青神县| 和田县| 德安县| 鸡泽县| 昌平区| 迭部县| 怀柔区|