Title: Enqueue the CSS
Last modified: December 4, 2016

---

# Enqueue the CSS

 *  Resolved [melriks](https://wordpress.org/support/users/melriks/)
 * (@melriks)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/enqueue-the-css/)
 * Developer Suggestion:
 * in widgets_on_pages.php
 * Rather than add the CSS directly to the document head.
 * Enqueue it. Give other developers a little more control over where the script
   will load without having to edit the core files directly.
 *     ```
       /* ===============================
         A D D    C S S    ? 
       ================================*/
       function add_wop_css()
       {
       	// echo "<link rel='stylesheet' id='wop-css'  href='".get_settings('siteurl')."/wp-content/plugins/widgets-on-pages/wop.css' type='text/css' media='all' />";
       	wp_register_style('wop-css', 'wp-content/plugins/widgets-on-pages/wop.css', array(), '1.0', 'all');
           wp_enqueue_style('wop-css'); // Enqueue it!
   
       	}
   
       $options = get_option('wop_options_field');
       $enable_css = $options["enable_css"];
       if ($enable_css) {
         //add_action('wp_head', 'add_wop_css_to_head');
         add_action( 'get_footer', 'add_wop_css' );
       }
       ```
   

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

 *  Plugin Author [toddhalfpenny](https://wordpress.org/support/users/toddhalfpenny/)
 * (@toddhalfpenny)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/enqueue-the-css/#post-8930141)
 * Oh crikey [@melriks](https://wordpress.org/support/users/melriks/), sorry, I’ve
   only just spotted this.
    Thanks for the post, and you’re absolutely right. This
   will be in the next release, for sure. Thanks again.
 *  Plugin Author [toddhalfpenny](https://wordpress.org/support/users/toddhalfpenny/)
 * (@toddhalfpenny)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/enqueue-the-css/#post-8937196)
 * Okey dokey – Implemented and tested and will be in the next release.
    Thanks!

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

The topic ‘Enqueue the CSS’ is closed to new replies.

 * ![](https://ps.w.org/widgets-on-pages/assets/icon.svg?rev=1400727)
 * [Widgets on Pages](https://wordpress.org/plugins/widgets-on-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widgets-on-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widgets-on-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/widgets-on-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widgets-on-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widgets-on-pages/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [toddhalfpenny](https://wordpress.org/support/users/toddhalfpenny/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/enqueue-the-css/#post-8937196)
 * Status: resolved