Remove stylesheet from pages & home page
-
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)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Remove stylesheet from pages & home page’ is closed to new replies.