Call to Action banner on every page

Hello!

First of all, great job on the Sparkling theme! I have made some customizations while using a child theme. I was wondering if it was possible to get the Call to Action banner visible on every page? Unfortunately I can’t figure out, how to do is.

Since you mentioned that you are already using Child Theme then this is going to be rather easy.

Simply copy/paste this code inside Child Theme functions.php file and Call for Action section will be display on every single page on your website.

if ( ! function_exists( 'sparkling_call_for_action' ) ) :
/**
 * Call for action text and button displayed above content
 */
function sparkling_call_for_action() {
  if ( of_get_option( 'w2f_cfa_text' )!=''){
    echo '<div class="cfa">';
      echo '<div class="container">';
        echo '<div class="col-sm-8">';
          echo '<span class="cfa-text">'. of_get_option( 'w2f_cfa_text' ).'</span>';
          echo '</div>';
          echo '<div class="col-sm-4">';
          echo '<a class="btn btn-lg cfa-button" href="'. of_get_option( 'w2f_cfa_link' ). '">'. of_get_option( 'w2f_cfa_button' ). '</a>';
          echo '</div>';
      echo '</div>';
    echo '</div>';
  }
}
endif;

Thanks, it works like a charm!

Have a great day!

Hello Aigars!

I’d like to replace the “call to action text and button” area with an widget area.

I just copied part of your code to create the CTA area… but, i dont know what to do then.

if ( ! function_exists( 'sparkling_call_for_action' ) ) :
/**
 * Call for action text and button displayed above content
 */
function sparkling_call_for_action() {
  if ( of_get_option( 'w2f_cfa_text' )!=''){
    echo '<div class="cfa">';
      echo '<div class="container">';
      
      
      echo '</div>';
    echo '</div>';
  }
}
endif;

I’m using a Child Theme and trying to follow this steps:
http://codex.wordpress.org/Widgetizing_Themes

but no luck until now…

Hi @danielspalma,

It’s old thread and to help keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/sparkling/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.

Thanks,
Movin