Forked from isGabe/wp-enqueue-gravity-forms-css.php
Last active
June 13, 2023 19:26
-
-
Save jarrodmedrano/a70c512c55c026df19ea to your computer and use it in GitHub Desktop.
Enqueue the css from Gravity Forms in WordPress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gravity Forms style sheet | |
wp_register_style( 'gravity-forms', get_stylesheet_directory_uri() . '/library/css/gravity-forms.css', array(), '' ); | |
// only load on contact page | |
if(is_page('contact')){ | |
wp_enqueue_style('gravity-forms'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A more universal solution is to enqueue the style with the
gf_enqueue_scripts
action:In my tests, this outputs the styles after the main gravity forms ones, but you could add a higher WP priority to ensure the styles appear later.