我正在尝试修改WooCommerce产品过滤器插件,以将过滤器添加为<div class="row">代替"col-md-6".
在functions.php中,我删除了挂钩到创建函数的函数col-md-6,编写了创建rows的新函数,并添加了挂钩到我的新函数中的动作.见下面的代码.
function filter_styling()
{
echo '<div class="row">';
}
function filter_styling2()
{
echo '</div><div class="row">';
}
function product_category_filter_changes()
{
remove_action('woocommerce_before_main_content','oxy_before_breadcrumbs', 19);
remove_action('woocommerce_before_main_content', 'oxy_after_breadcrumbs', 20);
add_action('woocommerce_before_main_content', 'filter_styling', 19);
add_action('woocommerce_before_main_content', 'filter_styling2', 20);
}
add_action('init','product_category_filter_changes',10);
Run Code Online (Sandbox Code Playgroud)
添加操作正在注册,但不是注销操作.有任何想法吗?
谢谢!担