How can I dequeue some of the css styles?

Bring Your Business to LifeSupportImage StoreHow can I dequeue some of the css styles?

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #150358
    yoderman94
    Member

    I want to pull the css styles into my style sheet but I need to dequeue the Image Store sheets. I have tried:

    wp_deregister_style ( ‘imstore’);
    wp_dequeue_style( ‘imstore’);

    wp_register_style ( ‘css-imstore’, get_stylesheet_directory_uri() . ‘/vendor/image-store/css/imstore.css’, ‘imstoreCSS’ );
    wp_enqueue_style( ‘css-imstore’);

    This will load the new style but the old style remains loaded which is causing conflicts.

    I realize that I can turn off the css in the options but shouldn’t there be a way to do it through code so I don’t have to recreate every css file?

    Thanks!

    Chad

    #152725
    Xpark Media
    Keymaster

    @yoderman94,

    Do you want to remove all or just some? To dequeue files, the dequeue function needs to run after image store has queued the styles.

    If you want to remove all css, just go to settings > general and uncheck “Use CSS”

    To dequeue some try:

    function dequeue_image_store_styles(){
    wp_dequeue_style('imstore');
    wp_dequeue_style('ims-single');
    wp_dequeue_style('imstore-store');
    }
    add_action( 'wp_enqueue_scripts', 'dequeue_image_store_styles', 100 );
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.