Support » Plugin: WooCommerce » Add custom element in footer shop pages
Add custom element in footer shop pages
-
Hello.
I’m trying to add custom elements before the footer in the woocommerce archive pages.I’ve tried a code like this one in the functions php of my theme:
function shop_categoria_bottom() { if ( is_woocommerce() ) { echo '<p>QUESTO E UN TEST</p>'; } }; add_action( 'get_footer', 'shop_categoria_bottom', 100 , 100);
The problem is that doing this, is not adding the text on the bottom and before the footer, but before the whole woocommerce page.
Screenshot: http://i.imgur.com/jpbPPi1.png
Thank you in advance
-
Hi, @kryuko
Please make sure that
get_footer
is an action, I think it’s a filter which may cause such behavior. But you may also check thefooter.php
in your theme for proper hooks.Thanks
I have tried everything in my footer.php but i still can’t add the elements before the footer.
So i’ve thinked to add the element after the woocommerce actions.I’ve tried with:
add_action( 'woocommerce_after_shop_loop', 'shop_categoria_bottom', 30);
But this add the element before the woocommerce pagination.
So i’ve tried with the woocommerce_pagination_args action. But i still get the element before the pagination, and it’s like the text is INSIDE the pagination div tag.
THanks in advance.
Gianmaria Generoso
Hi Friends,
Goto file archive-product.php and add content before get_footer() function.
Note:- you must override woocommerce templates in theme.
Thanks!
add_action( 'woocommerce_after_main_content ', 'custom_element', 40 ); function custom_element() { print '<p>HERE</p>'; }
The code goes in functions.php for your child theme. If you don’t have a child theme, you can use the “My Custom Functions” plugin.
Hookr (free)
http://hookr.io/plugin/
will show you which hooks fire where in your theme.Hey vshashi05,
I am going to resolve this thread since there has been no follow up for 5 months.
If you do still need help, please open up a new thread.
Cheers!
- The topic ‘Add custom element in footer shop pages’ is closed to new replies.