ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

page-settings.php (828B)


      1 <?php
      2 
      3 function materialis_smooth_scroll()
      4 {
      5     $section = "page_settings";
      6 
      7     materialis_add_kirki_field(array(
      8         'type'     => 'checkbox',
      9         'settings' => 'enable_smooth_scroll',
     10         'label'    => esc_html__('Enable smooth scrolling', 'materialis'),
     11         'section'  => $section,
     12         'default'  => false,
     13         'transport' => 'postMessage',
     14     ));
     15 }
     16 
     17 //materialis_smooth_scroll();
     18 
     19 
     20 add_action('wp_head', 'materialis_add_smooth_scroll');
     21 
     22 function materialis_add_smooth_scroll()
     23 {
     24     $enable_smooth_scroll = false;//materialis_get_theme_mod("enable_smooth_scroll", false);
     25     if ($enable_smooth_scroll) {
     26         $materialis_smooth_scroll = array("enabled" => true);
     27     	wp_localize_script(materialis_get_text_domain() . '-theme', 'materialis_smooth_scroll', $materialis_smooth_scroll);
     28     }
     29 }