-
I need a little help. I have created filters with wpgridbuilder I would like to hook them via function to the sidebar of the categories and the shop I tried this way by creating this hook I have a problem it prints it right inside the sidebar as the first element, but I don't know why it also prints it before the menu... (it fills it in twice). Do we have to use a different hook to call something inside the sidebar? Thank you very much for your help atm woocommerce.php get_header();
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is because there is no hook in Create hook in child's function add_facet_to_sidebar_hook() {
do_action('add_facet_to_sidebar_hook');
} function my_custom_facet_content() {
if (is_shop() || is_product_category() || is_product_tag()) {
echo '<div class="alert alert-info">This is my custom facet content!</div>';
}
}
add_action( 'add_facet_to_sidebar_hook', 'my_custom_facet_content' ); Copy <?php add_facet_to_sidebar_hook(); ?> Solved? |
Beta Was this translation helpful? Give feedback.
This is because there is no hook in
sidebar.php
, you have to create one.Create hook in child's
functions.php
:Copy
sidebar.php
to your child and insert the hook where you want:Solved?