Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Good day @asterbird

    We admittedly do not have a setting for that and preventing that file from being enqueued, but if you’re willing and comfortable enough to do some brief code edits, we can try to provide a workaround for you.

    Let us know how much you’d be comfortable with and we can start there.

    Thread Starter asterbird

    (@asterbird)

    Yes, I’m comfortable making php edits, preferably in the theme functions.php file. Let’s give it a go! ??

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    @asterbird give this a try. I’ve tested it out locally, and is working from what I can see.

    Basically we grab the post content and check for our formstack shortcode, and if it’s not present, it dequeues the css.

    function formstack_custom_shortcode_scripts() {
    	global $post;
    	if ( ! has_shortcode( $post->post_content, 'formstack' ) ) {
    		wp_dequeue_style( 'formstack-css' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'formstack_custom_shortcode_scripts', 11 );
    
    Thread Starter asterbird

    (@asterbird)

    Thanks so much for the code! I’ll try that.

    Thread Starter asterbird

    (@asterbird)

    That worked. thank you very much for the code and your help!

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Formstack loading css on pages not using Formstack’ is closed to new replies.