vendredi 18 mars 2016

building WordPress plugin with bootstrap without interfering existing theme

I have a very specific question, related to the context: I'm re-building a WP plugin that have already 1000+ active install.

I was thinking using Twitter bootstrap to make good responsiveness of my views, and adding it like this :

add_action('wp_head','head_code');
function head_code(){
    // compiled and minified CSS
    $headcode = '<link rel="stylesheet" href="http://ift.tt/1jAc5cP" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">';
    echo $headcode;
}

The problem this is totally interfering with the installed theme (changing the layout). I can't change anything in the theme nor the WP install, this is just a plugin that can be downloaded for the WP repository and have some backend and frontend views, I shouldn't change anything that is already existing on the website.

So I see only 2 ways : 1. I can "isolate" the bootstrap css only for my view's usage. If possible, how? 2. I have to use a more standard was of developing WP plugin and use other responsiveness best practice. What's your oppinion / feedback?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire