在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,
        )
    );
}

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

👋 感谢您的观看!

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享