在WordPress仪盘表栏添加”商店”分类

WordPress仪盘表后台添加”商店”分类,在functions.php添加如下代码:

add_action( 'init', 'create_post_type' );
function create_post_type() {
    register_post_type( 'shop',
        array(
            'labels' => array(
                'name' => __( '商店' ),
                'singular_name' => __( 'shop' )
            ),
            'public' => true,
            'has_archive' => true,
        )
    );
}

当然只是添加个分类显示名而已,其实没什么实质性的功能,更多的功能需要我们去开发。

鹿泽
鹿泽

深耕 SEO优化 十二年,从个人博客爱好者到专业谷歌优化顾问的成长之路。技术派SEO、全域流量技术运营专家,拥有多年从业经验,热衷于分析算法逻辑与推理的精准匹配。