How can I add a global block as a footer to WooCommerce pages?

Hi, I’ve used a global block as my footer and in functions.php (along with your help) I’ve added in code to add it to the bottom of the blog and portfolio pages, but now I’d like to add it onto the bottom of the WooCommerce pages but I haven’t got a clue how to do it! I’ve tried searching your forum but there isn’t anything relevant enough for what I need.

Here’s the code I currently have in the functions.php:

add_action( 'x_before_view_footer_base', 'x_print_gb' );
function x_print_gb(){
    if( x_is_portfolio() || is_singular('x-portfolio') || is_singular( 'post' ) || is_home()  ){
        echo do_shortcode( '[cs_gb id=158]' );
    }
}

I’d be very grateful if you could help me out with this please!

I’ll put the URL in a secure note as it’s currently on a staging site.

Thanks!

Hi @core365,

Thank you for writing in, WooCommerce has its own conditional tags, please see the following link.

If you are more interested in having control over all aspects of the footer I suggest that you consider the Pro theme which has a Footer builder and you can assign different footer on different posts/pages.

Cheers!

Hi @friech,

Thanks for the link, I’ve got it sorted now!

I don’t like using your Pro theme, I think it unnecessarily complicates the building of the header and footer when it comes to the responsive side of things.

Thanks!

Hello @core365,

You are most welcome. It’s good to know that you have sorted it out.

Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.