Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The wordpress theme I bought has some jQuery UI styling included in its default CSS file. The problem is I have a plugin that uses jQuery UI and the theme's default CSS makes the plugin corrupted. I want the default jquery UI CSS file to override UI styling contained in my theme's CSS file.
I see some people mentioned using Enqueue to make the jQuery CSS load in the bottom of the page, but I don't know how to do this. Thanks.

share|improve this question
1  
Well, be careful. If the theme's CSS can break the plugin's CSS then the reverse it true as well. Loading the plugin's CSS late could well make that happen. You are better off figuring out why the two stylesheets conflict and altering one or both so that they cooperate. Unfortunately, that makes this a CSS question which is off topic here per the faq. –  s_ha_dum Jan 17 '13 at 21:18
    
Hi, thanks for your reply. Why is it off topic? What I am asking is how to enqueue the jquery UI CSS file so it loads at the very end of my document on my plugin page, I believe that should do the trick. –  antosha Jan 17 '13 at 21:32
    
It is only off topic if you take my advice and edit the CSS to make them cooperate. That was conditional. Pure CSS questions are off topic. –  s_ha_dum Jan 17 '13 at 21:38
add comment

2 Answers

You might be able to try something like this in your footer:

<?php
function my_scripts_method() {
    wp_enqueue_script('<script name>','<script source>');            
}    

add_action('wp_enqueue_scripts', 'my_scripts_method'); // For use on the Front end (ie. Theme)
?>

Where <script> is the name of the script and <script source> is where it lives within your WP install.

If that doesn't help, maybe some of the other coding on the WP Codex page might help, wp_enqueue_script

share|improve this answer
add comment

You want the plugins style sheet to over ride your themes style sheet conditionally ( on one page).

Dequeue your themes style sheet for a specific page conditionally.

add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 25 );

function remove_default_stylesheet() {

if ( is_page( page id or slug) ) {

wp_dequeue_style( 'original-enqueue-stylesheet-handle' );
wp_deregister_style( 'original-register-stylesheet-handle' );

wp_register_style( 'new-style', plugins_url('stylesheet.css', __FILE__) );  
wp_enqueue_style( 'new-style' );

    }

}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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