1
我试图用列表替换woocommerce排序下拉列表,我有这个到目前为止工作正常。显示Woocommerce作为列表排序下拉列表
问题是选项没有转换为可点击的工作链接。任何想法我怎么能做到这一点?
<div class="wrapper-dropdown">
<span>I'm kinda the label!</span>
<ul class="dropdown">
<?php
$catalog_orderby = apply_filters('woocommerce_catalog_orderby', array(
'menu_order' => __('Default sorting', 'woocommerce'),
'popularity' => __('Sort by popularity', 'woocommerce'),
'rating' => __('Sort by average rating', 'woocommerce'),
'date' => __('Sort by newness', 'woocommerce'),
'price' => __('Sort by price: low to high', 'woocommerce'),
'price-desc' => __('Sort by price: high to low', 'woocommerce')
));
if (get_option('woocommerce_enable_review_rating') == 'no')
unset($catalog_orderby['rating']);
foreach ($catalog_orderby as $id => $name)
echo '<li>' . esc_attr($name) . '</li>';
?>
</ul>
感谢。
完美!谢谢 :) –