Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 自定义邮政类型与电子商务_Php_Css_Woocommerce - Fatal编程技术网

Php 自定义邮政类型与电子商务

Php 自定义邮政类型与电子商务,php,css,woocommerce,Php,Css,Woocommerce,我对分类有问题,我的“产品”分类有效,但我的“帖子”分类没有为我的产品显示 add_action( 'init', 'cptui_register_my_cpts' ); function cptui_register_my_cpts() { $labels = array( "name" => __( 'product', 'mh-magazine-lite' ), "singular_name" => __( 'product', 'mh-magazine-lit

我对分类有问题,我的“产品”分类有效,但我的“帖子”分类没有为我的产品显示

add_action( 'init', 'cptui_register_my_cpts' );
function cptui_register_my_cpts() {
$labels = array(
    "name" => __( 'product', 'mh-magazine-lite' ),
    "singular_name" => __( 'product', 'mh-magazine-lite' ),
    );

   $args = array(
    "label" => __( 'product', 'mh-magazine-lite' ),
    "labels" => $labels,
    "description" => "",
    "public" => true,
    "publicly_queryable" => true,
    "show_ui" => true,
    "show_in_rest" => false,
    "rest_base" => "",
    "has_archive" => false,
    "show_in_menu" => true,
            "exclude_from_search" => false,
    "capability_type" => "post",
    "map_meta_cap" => true,
    "hierarchical" => false,
    "rewrite" => array( "slug" => "product", "with_front" => true ),
    "query_var" => true,

    "supports" => false,        
    "taxonomies" => array( "category", "post_tag", "product_cat",            "product_tag", "product_shipping_class", "pa_shirt-sizes" ),
        );
register_post_type( "product", $args );

 // End of cptui_register_my_cpts()
 }

不知道如果这是可能的,您是否想要任何解决方案

您是否试图将您的标准“帖子”类别与您的“产品”帖子类型相关联?我有点困惑,当WooCommerce已经注册了一个自定义的帖子类型的“产品”时,为什么还要注册,但我想我可能有点误解了这个问题。是的。这正是我想做的,有什么建议可以帮我完成吗?你是想把你的标准“帖子”类别和你的帖子类型“产品”联系起来吗?我有点困惑,当WooCommerce已经注册了一个自定义的帖子类型的“产品”时,为什么还要注册,但我想我可能有点误解了这个问题。是的。这正是我想做的,有什么建议可以帮我完成吗?