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.

How to keep Gravity forms styling in a slider.

  1. Hi I am having an issue where the styling gets messed up when I try to display the form using the loop in a content slider. here is the page in question click on the link 2 tab http://prizeblade.com/front-page

    Posted 12 years ago on Monday August 15, 2011 | Permalink
  2. The issue is the CSS and JS likely isn't being enqueued automatically because of how you are implementing it. Gravity Forms can only automatically enqueue CSS and JS when used in a standard WordPress loop and not when doing more custom implementations.

    The solution is going to be enqueue the necessary CSS and JS manually. There is a function call to do this. You can find documentation for it here:

    http://www.gravityhelp.com/documentation/page/Gravity_form_enqueue_scripts

    The best way to do this is to call this function call in your themes functions.php file and wrap it in an if statement so it checks for the page id so it only executes if the page id is the page the form is on. Here is a post with an example:

    http://www.gravityhelp.com/forums/topic/form-not-displaying-when-using-conditional-logic-jquery-conflict#post-26288

    Posted 12 years ago on Tuesday August 16, 2011 | Permalink
  3. Ah yes that works! Although I was able to get it to work by omitting the If statement. Is and just adding

    <?php
        gravity_form_enqueue_scripts(1, true);
    ?>

    To my front page template. Is it a problem just having that or do you think its fine?

    Posted 12 years ago on Tuesday August 16, 2011 | Permalink
  4. If it's in your front page template and not in your functions.php, that is fine. The main thing with the if statement is if you put it in your functions.php file it's going to execute for every single page load... which is why the if statement is there so it only executes on a specific page. But if it works in the theme template file for that page, that is fine too.

    Posted 12 years ago on Tuesday August 16, 2011 | Permalink

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