我按类别和自定义meta_key在自定义页面模板上过滤我的Woocommerce产品 . 现在我试图回应产品被过滤的类别名称 .
过滤产品后的网址看起来像
.../online-shop/popular-products/?product-cato=23
23是类别的ID . 我可以使用以下内容获取(或回显)id
<?php echo sanitize_text_field($_GET['product-cato']);?>
Any idea how to get the category name with the available cateogry ID (in this case 23)?
1 回答
您可以尝试使用以下内容:
经过测试和工作 .