📌  相关文章
📜  将标题图像添加到 woocomerce 商店页面 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:49.294000             🧑  作者: Mango

代码示例1
//Check is_shop - Shop base page
        // if True then Show Category Header Content of The first Product in Shop base Page 
        
if (is_shop()) {
        $args = array('taxonomy' => 'product_cat');
        $product_categories = get_categories( $args  );
        $term_id = $product_categories[0]->term_id;  
        $content = get_term_meta($term_id, 'cat_meta');
        if(isset($content[0]['cat_header'])){
            echo do_shortcode($content[0]['cat_header']);
        }
}