/ Documentation /Advanced/How to Create a Language Specific Popup in Convert Pro?

How to Create a Language Specific Popup in Convert Pro?

Convert Pro allows you to create Language Specific Call-to-actions to make sure you are serving the right audiences.

In order to proceed, first you need to create a new call-to-action for your specific language.

You will need the things mentioned below:

  • WPML installed on your site.
  • Your call-to-action ID – You can find:
    • By clicking on the insight info icon under each popup here.
    • A popup will appear, i.e. Behaviour Quick view under that get the call-to-action ID here.
  • Your language code – WPML -> Languages -> Edit languages screen here.

Add below code to your theme’s functions.php file,

function cpro_callback_function( $display, $style_id ) {
     
     if( $display ) {
        // Replace call-to-action id with your call-to-action ID
        if( '31' == $style_id ) {
            
            if( defined( 'ICL_LANGUAGE_CODE' ) ) {
            
                // get current language code
                $language_code = ICL_LANGUAGE_CODE;
                        
                // replace fr with your language code 
                if( 'fr' == $language_code ) {
                    $display = true;
                } else {
                    $display = false;
                }
            }
        }
    }
 
    return $display;
}
add_filter( 'cp_pro_target_page_settings', 'cpro_callback_function', 10, 3 );
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page

Compare Convert Pro with...

29439
29440
Scroll to Top