PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Conditional load of scripts and CSS

  1. Hello.

    I am trying to prevent the load of the gravity forms style sheet on a particular page.

    I tried this: http://www.pastie.org/1844330

    It did not work. Was wondering how I would prevent the CSS from loading on my homepage (or conditionally on any other page)?

    Thanks!

    Posted 13 years ago on Thursday April 28, 2011 | Permalink
  2. I figured it out.

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    function my_deregister_styles() {
    if ( is_front_page() ) {
    wp_deregister_style( 'gforms_css' );
    }
    }

    Thanks!

    Posted 13 years ago on Thursday April 28, 2011 | Permalink

This topic has been resolved and has been closed to new replies.