Title: Correctly Enqueue Stylesheets
Last modified: August 22, 2016

---

# Correctly Enqueue Stylesheets

 *  Resolved [harman79](https://wordpress.org/support/users/harman79/)
 * (@harman79)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/correctly-enqueue-stylesheets/)
 * Hi all,
 * I really need some help with how to correctly enqueue the various styles in the
   kadence theme.
 * I want all css inside main theme directory to be loaded first, all css generated
   via back panel options to be loaded second and all css that I add in my child
   theme to be loaded last and thus be the most important.
 * How do I work around this? Do I first have to deregister all styles, re-register
   them, and then correctly enqueue them in my functions css? How do i do that for
   the css generated via back-panel options?
 * Thanks
    Harry

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/correctly-enqueue-stylesheets/#post-5738202)
 * Hi,
    hmm, You can’t really do that. The css generated by the theme options is
   php and not enqueued. but there is a workaround, You could use this function 
   to make the child css load after the theme options.
 *     ```
       function kadence_child_scripts() {
       	wp_dequeue_style('kadence_child');
       }
       add_action('wp_enqueue_scripts', 'kadence_child_scripts', 101);
       function kadence_child_add() {
       	echo '<link rel="stylesheet" id="kadence_child_after-css" href="'.get_stylesheet_uri().'" type="text/css" media="all">';
       }
       add_action('wp_head', 'kadence_child_add', 250);
       ```
   
 * Out of curiosity? Why override the theme options? Why not just change them to
   what you want? Or make your child theme have a deeper css selection.
 * Kadence Themes
 *  Thread Starter [harman79](https://wordpress.org/support/users/harman79/)
 * (@harman79)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/correctly-enqueue-stylesheets/#post-5738211)
 * Hi,
 * thanks very much for your reply. Your suggestion worked like a charm and I can
   now farewell the numerous silly !importants from my css.
 * To answer your question, the site I am developing is fullscreen and heavily backgrounded.
   Therefore I had to stack backgrounds one on top of the other for the various 
   divs of the theme (body, footer, header) so that it looks nice at all resolutions.
   Expectedly, your awesome theme does not offer such option. I mean, that would
   be an overkill..
 * Thanks once again guys. Your support team is one the best support teams out there.
 * Harry

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Correctly Enqueue Stylesheets’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/virtue/3.4.15/screenshot.png)
 * Virtue
 * [Support Threads](https://wordpress.org/support/theme/virtue/)
 * [Active Topics](https://wordpress.org/support/theme/virtue/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/virtue/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/virtue/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)

 * 2 replies
 * 2 participants
 * Last reply from: [harman79](https://wordpress.org/support/users/harman79/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/correctly-enqueue-stylesheets/#post-5738211)
 * Status: resolved