php 存档中的WooCommerce产品类别下拉列表
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 存档中的WooCommerce产品类别下拉列表相关的知识,希望对你有一定的参考价值。
<?php // <~ don't add me in
add_action( 'widgets_init', 'wb_extra_widgets' );
/**
* Register new Widget area for Product Cat sort dropdown.
*/
function wb_extra_widgets() {
register_sidebar( array(
'id' => 'prod_sort',
'name' => __( 'Product Cat Sort', 'themename' ),
'description' => __( 'This site below Shop Title', 'themename' ),
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
) );
}
add_action( 'woocommerce_before_shop_loop','wb_prod_sort' ); // Hook it after headline and before loop
/**
* Position the Product Category Sort dropdown.
*/
function wb_prod_sort() {
if ( is_active_sidebar( 'prod_sort' ) ) {
dynamic_sidebar( 'prod_sort' );
}
}
以上是关于php 存档中的WooCommerce产品类别下拉列表的主要内容,如果未能解决你的问题,请参考以下文章