How to load css in the footer in WordPress?

Posted by Pinki | Updated on

If you want to load css in the footer in WordPress? Actually all styles should be placed in header. So WordPress doesn’t have a parameter for doing this in the wp_enqueue_style function, because traditionally all styles were added in the head. Recently, many sites have moved to a system where critical “above the fold” styles are loaded in the head, while other styles are loaded in the footer.

So here is a way to to this: You can use print_late_styles() function which is called in footer. You just need to enqueue your styles when header is already passed.

So you need to find some hook which is called on each page and after wp_head hook. For example get_footer could be one.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers