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 Logic clashing with theme

  1. hmarcks
    Member

    My form doesn't show when conditional logic is used, and I've determined it's a theme issue (works in Twenty Ten).

    Could anyone point me to where the conflict might be?

    The form is located here: http://revelstokewhisky.com/revelV2/#contact

    Also, the theme does not appear when previewed in the form builder.

    Thank you!

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  2. @hmarcks your jQuery reference is in the footer: Screenshot

    We require this to be in the head because we make references to jQuery functions, especially when using conditional logic that are being called above the jQuery script call-in.

    @johnw can you post a link to your form?

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  3. hmarcks
    Member

    I placed this code in the header:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

    It still doesn't show in the preview or on the site.

    I also tried loading it this way as suggested by Wordpress:

    <?php
    function my_scripts_method() {
        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
        wp_enqueue_script( 'jquery' );
    }    
    
    add_action('wp_enqueue_scripts', 'my_scripts_method');
    ?>
    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  4. Now get rid of the call in your footer (that is still there) and see if that makes a difference.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  5. hmarcks
    Member

    No luck. I tried removing everything from the footer besides wp_footer.

    I also tried putting all of the footer script in the header, but this yielded nothing.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  6. When i download your page locally and remove this from the footer:
    Screenshot

    It works:

    Screenshot

    Adding that back in, causes it not to work:

    Screenshot

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  7. hmarcks
    Member

    The only thing that was in the footer was wp_footer. I removed this and the form shows, but it killed all my other script (such as scrolling transitions).

    I put all the footer script in the header, but this didn't revive my scrolling transitions.

    Thanks for your help, Rob. I know this is more an issue with the theme.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  8. @hmarcks: this appears on line 3029 (really, over 3000 lines in this rendered page):

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

    This is being put their somehow by your theme (Themeforest Spark theme?) This is the error that is showing up:

    Timestamp: 7/20/2012 6:56:42 AM
    Error: ReferenceError: jQuery is not defined
    Source File: http://revelstokewhisky.com/revelV2/#contact
    Line: 2992

    jQuery is still being loaded at the end of the page, rather than at the beginning, so any function that relies on jQuery will not work, because it's not yet available. Resolve that error and your forms with conditional logic and AJAX will work fine.

    Posted 12 years ago on Friday July 20, 2012 | Permalink