Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #897524

    Hi I have a page which should load a certain number of custom stylesheets. It worked until now, but as I changed some css rules I realized that actually it doesn’t load them in a proper way. By analyzing the page with an inspector I see that the css files are registered as “inline” and I do not see the files uploaded. However they are applied, at least the old ones. I noticed it as I changed one rule (see below)
    Strangely the thing works fine in my Mamp local page (where I can see all the css files loaded), but not online.

    You can have a look (link in a private section) by inspecting the element which opens the yello submenu. In the older version the opener was a blue hamburger icon, while in the new version there should be a magnifier lense.
    new style rule are the following elements (which are not loaded): .search, .magnifying-glass, .search__cross
    old style rules (deleted) were applied to the element .menu-opener-inner (which still exist but has no css rules applied)

    It seems that it has recorded somewhere the old style sheet, but I have no idea since the css files are all in a single folder within the child theme

    The code I used to enque styles and scripts is as follows:

    function add_custom_map_styles() {
        $child_theme_url = get_stylesheet_directory_uri();
        if (is_page('2032') || is_page('2547')) {
            wp_register_style( 'ol-css', $child_theme_url.'/maps/ol/ol.css');
            wp_register_style( 'immas-style-css' ,  $child_theme_url.'/maps/css/immas-style.css'); 
            wp_register_style( 'easy-autocomplete-css' ,  $child_theme_url.'/maps/autocomplete/easy-autocomplete.min.css'); 
            wp_register_style( 'menu-style-css' ,  $child_theme_url.'/maps/css/menu-style.css'); 
            wp_register_style( 'taxonomy-table-css' ,  $child_theme_url.'/maps/css/taxonomy-table-style.css');
    
            wp_enqueue_style( 'ol-css');
            wp_enqueue_style( 'immas-style-css');
            wp_enqueue_style( 'easy-autocomplete-css');
            wp_enqueue_style( 'menu-style-css');
            wp_enqueue_style( 'taxonomy-table-css');
        }
    }
    add_action( 'wp_enqueue_scripts', 'add_custom_map_styles
    function add_custom_map_scripts()
    	{
    		$child_theme_url = get_stylesheet_directory_uri();
    
    		if (is_page('2032') || is_page('2547')) {
                /*
    			  wp_enqueue_script( 'jquery', $child_theme_url.'/maps/autocomplete/jquery-2.1.3.min.js',array('jquery'));
    			  wp_enqueue_script( 'polyfill-script', 'https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL');
    			  wp_enqueue_script( 'ol-script', $child_theme_url.'/maps/ol/ol.js',array('jquery'));
    			  wp_enqueue_script( 'functions-script', $child_theme_url.'/maps/custom_js/functions.js',array('jquery'));
    			  wp_enqueue_script( 'easy-autocomplete-script', $child_theme_url.'/maps/autocomplete/jquery.easy-autocomplete.min.js',array('jquery'));
                  wp_enqueue_script( 'menu-opener-script', $child_theme_url.'/maps/custom_js/menu-opener.js', 1, true);
    			  wp_enqueue_script( 'layers-script', $child_theme_url.'/maps/custom_js/layers.js',array('jquery'));
    			  wp_enqueue_script( 'immas_map-script', $child_theme_url.'/maps/custom_js/immas_map.js',array('jquery'), null, true);
                  wp_enqueue_script( 'clean_view-script', $child_theme_url.'/maps/custom_js/clean_view.js',array('jquery'), null, true);
    			  wp_enqueue_script( 'taxonomy_table-script', $child_theme_url.'/maps/custom_js/taxonomy_table.js',array('jquery'), null, true);
      
    		}
    	}
    add_action( 'wp_enqueue_scripts', 'add_custom_map_scripts' );

    I am going to give you also the ftp access in order to give a look to the single files

    #897571

    I found which was the problem: I installed and activated some time ago the plugin Fast Velocity Minify which I imagine created a minified copy of my CSS files. The site was pointing to it and not to the last version of css files I uploaded. Hence any change to it didn’t work. I deactivated it and everything was working fine

    Sorry for the disturb, but this may be of help for someone else

    #897606

    Hi,

    Glad to hear that it’s fixed and thanks for sharing this info, it would really be helpful. Thanks for using Enfold, have a nice day! :)

    Best regards,
    Nikko

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Custom css stylesheets are not properly loaded’ is closed to new replies.