0

I'm finding that plugins completely destroy my source formatting and generally suck at following standards.

How can I absolutely block all style-sheets and move all .js to the footer of the site without modifying the plugins or adding an additional plugin?

Here's an example of what my homepage looks like under their rule http://pastebin.com/KRxRyYM7

1 Answer 1

1

WordPress plugins usually enqueue's their stylesheets and js files using wp_enqueue_style and wp_enqueue_script functions. You can dequeue script / dequeue style the scripts/styles if you don't want them in your theme. These css/js files usually loads with wp_head() action, which usually resides in your header.php in the theme

3
  • +1, but I'd say that they shouldn't be enqueued/registered in header.php. this is stuff for functions.php.
    – kaiser
    Commented Aug 17, 2011 at 22:42
  • wait, I'm confused. Wouldn't you always enque or register it in functions.php? Commented Aug 18, 2011 at 17:56
  • 1
    Yes, you can just use like this ` function theme_dequeue() { wp_dequeue_script( 'KEY_NAME' ); } add_action( 'template_redirect', 'theme_dequeue' );` You just need to find out the KEY_NAME of that script when it was enqueued.
    – Tareq
    Commented Aug 24, 2011 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.