-
-
Save norewp/32f9593c71c04ad13b4ecb825a21949f to your computer and use it in GitHub Desktop.
Revisions
-
nicomollet revised this gist
Aug 24, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,5 +11,11 @@ function elementor_css_in_head(){ $elementor = \ElementorPro\Plugin::instance(); $elementor->enqueue_styles(); } if(class_exists('\Elementor\Post_CSS_File')){ $elementor_page_id = 3167; // Elementor page ID serving as a template (for a header or footer) $css_file = new \Elementor\Post_CSS_File( $elementor_page_id ); $css_file->enqueue(); } } add_action( 'wp_enqueue_scripts', 'elementor_css_in_head' ); -
nicomollet created this gist
Aug 24, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ <?php /** * Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer */ function elementor_css_in_head(){ if(class_exists('\Elementor\Plugin')){ $elementor = \Elementor\Plugin::instance(); $elementor->frontend->enqueue_styles(); } if(class_exists('\ElementorPro\Plugin')){ $elementor = \ElementorPro\Plugin::instance(); $elementor->enqueue_styles(); } } add_action( 'wp_enqueue_scripts', 'elementor_css_in_head' );