Php 如何将项目符号和产品SKU添加到阵列列表中的产品标题
我有一个为WooCommerce定制的产品页面,在其各自的类别标题下显示产品列表。您可以在此处查看该页面: 我需要对产品列表做两件事:Php 如何将项目符号和产品SKU添加到阵列列表中的产品标题,php,html,css,wordpress,woocommerce,Php,Html,Css,Wordpress,Woocommerce,我有一个为WooCommerce定制的产品页面,在其各自的类别标题下显示产品列表。您可以在此处查看该页面: 我需要对产品列表做两件事: 在每个产品标题前添加项目符号 将产品SKU添加到每个产品标题的末尾(例如,“Citizen M32 CNC瑞士螺纹机(#47623)) 由于这不是商店页面,我不确定如何调用需要显示的SKU。我不介意在产品标题末尾的任何地方显示SKU,但我不想将其添加到每个帖子的实际标题中 我可以在分类标题中添加要点,但不知道如何将它们添加到产品标题中 <!
<!-- section -->
<section>
<?php
$args = array(
'taxonomy' => "product_cat",
'orderby' => 'title',
'order' => 'ASC',
'hide_empty' => true/* ,
'include' => $ids */
);
$product_categories = get_terms($args);
foreach($product_categories as $product_category){
$args = array(
'post_type' => 'product',
'orderby' => 'title',
'order' => 'ASC',
'posts_per_page' => -1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => $product_category->slug
)
),
);
$loop = new WP_Query( $args );
if($product_category->count > 0){
$count_h = 0;
while ( $loop->have_posts() ) : $loop->the_post();
global $product;
$count_h ++;
if($product->catalog_visibility == 'visible'){
if($count_h == 1){
echo "<br><a href='".get_category_link($product_category->term_id)."'><strong style='text-transform: uppercase;'><li>".$product_category->name.'</li></strong></a><br>';
}
echo '<a href="'.get_permalink().'">'.get_the_title().'</a><br />';
}
endwhile;
}
wp_reset_query();
}
我们需要更多的信息。这张桌子看起来像什么?我们需要更多的信息。这张桌子看起来像什么?