Adding the switcher with PHP
Put this in your theme where you want the button, for example in header.php:
<?php if ( class_exists( 'CLS_Pro' ) ) echo CLS_Pro::trigger(); ?>
With options:
<?php
if ( class_exists( 'CLS_Pro' ) ) {
echo CLS_Pro::trigger( [
'style' => 'minimal', // pill | minimal | classic | card | icon_only
'mobile_style' => 'icon_only', // optional
'show_arrow' => false, // optional
] );
}
The class_exists() check keeps your theme working if the plugin is ever turned off. The language window is added to the page automatically. See Developers β PHP API for everything else.