• Resolved glen_f

    (@glen_f)


    Hi

    I’ve been searching the forum a lot but I’ve not seen a working solution to deregistering styles. I need to remove stylesheet so overwriting is not a solution.

    THe stylesheet I currently want to remove is tiled-gallery.css. I’ve tried to include
    wp_deregister_style('tiled-gallery');
    and
    wp_deregister_style('tiled-gallery.css');
    to my functions following this kind of instructions http://www.tjkelly.com/remove-wordpress-jetpack-css/ with no luck.

    I have managed to deregister other styles (contact-form-7) succesfully on the same function so the function does work.

    WP is the latest (3.5.1)
    Jetpack is 2.2
    Base theme is Bones

    http://wordpress.org/extend/plugins/jetpack/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    The Tiled Gallery CSS file is added later, so the tutorial you mentioned in your post won’t work.

    Try the following code instead:

    function tweakjp_rm_tiledcss(){
    	wp_dequeue_style( 'tiled-gallery' );
    }
    add_action( 'post_gallery', 'tweakjp_rm_tiledcss', 1002 );
    Thread Starter glen_f

    (@glen_f)

    It kinda works. But then again it loses the functionality. I don’t want to lose the functionality of the gallery.

    I’ve got the styles added to my site wide stylesheet already and I’m trying to loose the extra requests.

    So the solution is close but not working. I’m still struggling with WordPress’s way of handling these plugin styles and scripts.

    So thank you for your help.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Try to hook into wp_footer instead, that should do the trick:

    function tweakjp_rm_tiledcss(){
    	wp_dequeue_style( 'tiled-gallery' );
    }
    add_action( 'wp_footer', 'tweakjp_rm_tiledcss' );
    Thread Starter glen_f

    (@glen_f)

    Thank you very much. This day isn’t that bad because I’ve learned something new today.

    It works. Still a long way to learn with the wp hooks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Howto deregister Jetpack styles’ is closed to new replies.