// 产品分组板块短代码（稳定版，无php闭合语法坑）
function product_group_grid_shortcode($atts) {
    $atts = shortcode_atts(array(
        'title' => '',
        'items'  => ''
    ), $atts);
    if (empty($atts['title']) || empty($atts['items'])) {
        return '';
    }
    $html  = '<div style="clear:both; display:block; width:100%; box-sizing:border-box; border:2px solid #ff6622; margin:16px 0; overflow:hidden;">';
    $html .= '<h3 style="text-align:center; color:#ff6622; font-size:28px; margin:16px 0 12px 0; padding:0;">' . esc_html($atts['title']) . '</h3>';
    $html .= '<div style="display:grid; grid-template-columns: 1fr 1fr; padding:10px 20px; gap:14px;">';
    $items_arr = explode(',', $atts['items']);
    foreach ($items_arr as $name) {
        $name = trim($name);
        $term = get_term_by('name', $name, 'product-cat');
        $html .= '<div style="text-align:center; font-size:20px; padding:8px;">';
        if ($term && !is_wp_error($term)) {
            $link = esc_url(get_term_link($term));
            $html .= '<a href="' . $link . '" style="color:#333; text-decoration:none;">' . esc_html($name) . '</a>';
        } else {
            $html .= esc_html($name);
        }
        $html .= '</div>';
    }
    $html .= '</div></div>';
    return $html;
}
add_shortcode('product_group', 'product_group_grid_shortcode');
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://test.szshouyiren.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://test.szshouyiren.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://test.szshouyiren.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://test.szshouyiren.com/wp-sitemap-posts-product-1.xml</loc></sitemap><sitemap><loc>https://test.szshouyiren.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://test.szshouyiren.com/wp-sitemap-taxonomies-product-cat-1.xml</loc></sitemap><sitemap><loc>https://test.szshouyiren.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
