Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Autosave removing CSS code

Discussion in 'Misc WordPress Requests' started by HudsonValleyWebDesign, Dec 4, 2017.

  1. HudsonValleyWebDesign


    Reply To: Autosave removing CSS code, by HudsonValleyWebDesign

    Since you are using a child theme, the functions required to conditionally load the JS files is quite easy to implement without the need for a plugin. I use it on a theme like this:

    // enqueue styles
    function load_my_scripts_styles() {

    if (is_page('personnel')) {
    // Loads Perfect Scrollbar JavaScript file.
    wp_enqueue_script('PerfectScrollbarjs', get_template_directory_uri() . '/library/js/perfect-scrollbar.min.js', array('jquery'),'', true );
    // Loads Perfect Scrollbar CSS file.
    wp_enqueue_style('PerfectScrollbarCSS', get_template_directory_uri() . '/library/css/perfect-scrollbar.min.css', false ,'');

    add_action('wp_enqueue_scripts', 'load_my_scripts_styles');

    Reply To: Autosave removing CSS code

Share This Page

Monarch Social Sharing Plugin