Support » Plugin: Scriptless Social Sharing » Remove stylesheet from pages & home page

  • Resolved Michael

    (@taco777)


    I want to remove the plugin’s stylesheet from loading on anything except a single post.

    On a simple blog site the following code works removing from the home (posts) page.

    function dequeue_scriptless_sharing_css() {
    
        if (is_home()) {
            wp_dequeue_style(‘scriptlesssocialsharing’);
        }
    }
    add_action(‘wp_enqueue_scripts’, ‘dequeue_scriptless_sharing_css’, 20);

    On another site (linked one) it has a static page as the home page and therefore this code should work.

    function dequeue_scriptless_sharing_css() {
    
        if (is_front_page()) {
            wp_dequeue_style(‘scriptlesssocialsharing’);
        }
    }
    add_action(‘wp_enqueue_scripts’, ‘dequeue_scriptless_sharing_css’, 20);

    But it doesn’t. And neither does targeting individual pages either by page name or number.

    How would I go about removing the stylesheet loading on pages?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    The code you have posted is working correctly for me–on the site where you are having the issue, do you have any other code added to modify this plugin behavior?

    However, you have uncovered a bug, as the plugin should not be loading the stylesheet unless buttons are being output. I’ve pushed a fix to the related file on the Github repository and it will be resolved in the next release, at which point you should no longer need the code.

    Thank you for bringing this to my attention, and I apologize for the inconvenience.

    Thread Starter Michael

    (@taco777)

    Thanks Robin, I tested the dev version and it’s working perfectly.

    Plugin Author Robin Cornett

    (@littlerchicken)

    Thank you for trying it out and letting me know!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove stylesheet from pages & home page’ is closed to new replies.