大家节日快乐 .
我带着我的年龄,无法实现它 .
我创建了一个Woocommerce属性Brand,其条款是该产品的品牌 .
首先,我正在尝试为每个品牌设置一个图像,以显示在其存档页面和单个产品上 .
这是我在archive-product.php中放置的代码:

<div class="row">
            <div class="col-lg-12">
                <div class="white-block block-pad log-in text-center">
                    <h1><?php  if (term_is_ancestor_of(3, $term, 'brand')) { echo woocommerce_page_title();} ?></h1>


  <?php
    $products_category_object       = get_queried_object();
    $product_category_taxonomy      = $products_category_object->taxonomy;
    $product_category_term_id       = $products_category_object->term_id;
    $cat_img = get_field('img_cat_brand', $product_category_taxonomy.'_'.$product_category_term_id);
    $alt = $cat_img['alt'];
    ?>
    <img src="<?php echo $cat_img['url']; ?>" alt="<?php echo $alt; ?>" />

但是我遇到了一些问题:

1)我'm trying to make an if statement where if we'在一个品牌的存档页面上,例如 . /brand/first-brand/ ,我想隐藏 Headers 只显示图像 . 但找不到可行的代码 .
2)显示图像,但是alt不知道为什么 .
3)我担心使用图像字段输入,因为我想让服务器节省时间做无用的查询,所以设置我选择的图像,而不查询wordpress生成的图像的哪个版本(商店,小,中,大等)
4)如果是产品,如果我选择品牌"first brand"作为品牌属性,我想显示相同的图像i 've used in the brand category to show up in the single product page. Ex. I'已设置品牌XXX的品牌标识,它出现在其档案/品牌/ xxx /中 . 然后我设置了一个产品,我在属性品牌中选择了xxx . 品牌徽标也应出现在产品页面中 .
请注意,我正在使用插件,但是为了个人理解/改进和网站性能,我想手动完成,因此如果你们可以提供帮助,我会非常感激 .
谢谢!