This is an interesting topic. A WordPress/WooCommerce client could not add CSS via the usual way. In fact, Gravity Forms plugin (and in particular the “directory” extension), stores entries in the database BUT the directory page and the entries filtered list have the same classes, ids, and cannot be “targeted” with CSS.

Long story short, and Gravity Form or not Gravity Form, here’s the snippet you can use to add CSS to any WordPress page as long as you know its URL.

PHP Snippet: Apply CSS to a Page URL That Contains “string”

 * @snippet       Apply CSS if URL contains string - WordPress
 * @how-to        Get FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.5.7
 * @donate $9

add_action( 'init', 'bbloomer_apply_css_if_url_contains_string' );
function bbloomer_apply_css_if_url_contains_string() {
if ( false !== strpos( $url, 'string' ) ) {
    echo '<style type="text/css">
         .entry-title { color: red }

Leave a Reply