Footer Custom CTA Block

Hi there,

I would like the big blue CTA above the footer to be consistent on every page and post. I don’t know how to add it as a consistent element in the theme. Currently I’ve added it manually in all the pages but I can’t get it to work for the posts. Please can you let me know how I would go about achieving this throughout the site.

Thanks, Lisa

Hey Lisa,

The content in post is contained so it’s not possible to make them span fullwidth without a custom script.

For this, you will need to assign a custom class to your CTA section like cta and add this code in Theme Options > JS.

jQuery('.cta').insertBefore('.x-colophon.top');

Hope that helps.

Thank you! I will give that a try, but before I do, is there any way to make that CTA stick to the footer so that any content added below the post (like the author box or a grid of related content) would always be placed above the CTA footer and never below?

Please can you explain to me how to apply a custom class to the CTA? Thank you!

Go to Section > Customize and insert cta in the Class field. I’d recommend that you get familiar with the elements’ interface or options.

Thanks.

Thank you so much that worked brilliantly!!

Glad we were able to help :slight_smile:

Hi again, how would I be able to do the same thing but on my category archive pages so that the same CTA is placed above the footer for all archive pages? Thank you!!

Hi There,

To achieve that, I suggest you to use the Global Blocks feature instead.

After that add this custom code under functions.php file locates in your child theme:

add_action( 'x_before_colophon_begin', 'x_print_global_block' );
function x_print_global_block(){
  echo do_shortcode( '[cs_gb id=203]' );
}

The 203 number should be your global block ID.

Hope that helps and thank you for understanding.

Hi there, thank you for this!

Where do I add the code in the functions.php - I added it at the end b ut it is not having any effect that I can see.

Do you have any suggestions for me please. Thank you!

Hi,

You can add it anywhere after this line of code

// Additional Functions
// =============================================================================

Please try changing your code to this

add_action( 'x_before_view_global__footer-widget-areas', 'x_print_global_block' );
function x_print_global_block(){
  echo do_shortcode( '[cs_gb id=203]' );
}

Hope that helps

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