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.

Click "Show results" and page get scrambled

  1. dansod
    Member

    Hi,

    I use this shortcode to display a poll on a WP page:

    [php]
    [gravityform action="polls" id="25" mode="poll" style="red" show_results_link="true" display_results="true" percentages="true" counts="true"]

    All looks good until I hit the "Show results" button. When the page reloads the whole page is suddenly scrambled with content displaced all over the page. I've found it's due to a missing </div>. If I place one after the shortcode the page looks better:

    [php]
    [gravityform action="polls" id="25" mode="poll" style="red" show_results_link="true" display_results="true" percentages="true" counts="true"]</div>

    But now the side menu on the page disappears! I'm using a theme (Modernize) on top of WP. This is probably the problem. But what to do?

    I also have problem with the GF widget that uses the unordered list ( <ul> ) code from the theme's css, which looks bad.

    Regards
    Johan

    Posted 11 years ago on Tuesday November 27, 2012 | Permalink
  2. David Peralty

    Hi there, can you link to your form without the extra end div call so we can take a look at what is happening?

    Posted 11 years ago on Tuesday November 27, 2012 | Permalink
  3. dansod
    Member

    Hi,

    thanks for the help.

    Here is the url. The site is under development, but I hope you can reach it anyway. The test poll is at the bottom:

    http://nordicgreen.cag.se/sv/bli-elkund/prishistorik/

    Also, I inserted the widget version of the poll on this page:

    http://nordicgreen.cag.se/sv/fornybar-energi/allt-om-elmarknaden/hur-fungerar-elmarknaden/

    There you see how the plug-in "picks up" the arrows and the <hr> code from the theme, although I guess it shouldn't. Luckily, the widget version doesn't screw up the page when you click on it, but the lines and arrows make it look ugly.

    Regards
    Johan

    Posted 11 years ago on Wednesday November 28, 2012 | Permalink
  4. There is some additional markup being added to the Gravity Forms shortcode output. This is typically done by themes which include the [raw] shortcode. Looks like you're using Modernize, which is available from Themeforest. Themeforest themes typically include the [raw] shortcode and it causes all sorts of problems. Read more here: http://www.gravityhelp.com/forums/tags/raw

    The quick fix is to wrap the [gravityform] shortcode in the [raw] shortcode. See if that takes care of the closing div problem.

    If it does, then we can work on your other CSS issues.

    Posted 11 years ago on Wednesday November 28, 2012 | Permalink
  5. dansod
    Member

    Hi,

    I tried the [raw] code but it didn't work. Nor did the [noformat] code. I also deactivated all plug ins but that didn't do it either. I couldn't find the code below in the shortcodes.php WP file:

    function my_formatter($content) {
        $new_content = '';
        $pattern_full = '{(\[raw\].*?\[/raw\])}is';
        $pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
        $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
    
        foreach ($pieces as $piece) {
            if (preg_match($pattern_contents, $piece, $matches)) {
                $new_content .= $matches[1];
                } else {
                $new_content .= wptexturize(wpautop($piece));
                }
            }
    return $new_content;
    }
    
    remove_filter('the_content', 'wpautop');
    remove_filter('the_content', 'wptexturize');
    add_filter('the_content', 'my_formatter', 99);

    so I couldn't comment it out, as proposed in some of the posts. The plot thickens. Probably GF is clashing with my theme somehow.

    Regards

    Johan

    Posted 11 years ago on Thursday November 29, 2012 | Permalink
  6. The developer of the polls add-on will take a look at this for you and update the topic tomorrow. Thank you for your patience.

    Posted 11 years ago on Thursday November 29, 2012 | Permalink
  7. dansod
    Member

    Thank you for taking time with this.

    Johan

    Posted 11 years ago on Friday November 30, 2012 | Permalink
  8. Steve Henty
    Administrator

    Hi Johan, I've sent you an email.
    Steve

    Posted 11 years ago on Friday November 30, 2012 | Permalink
  9. HOW DID YOU FIX IT!?

    Posted 11 years ago on Saturday February 9, 2013 | Permalink
  10. @glbranding, please begin a new topic for your issue. Explain what is happening. Let us know what version of WordPress, Gravity Forms and the Polls add-on you're using, and share a URL to the page on your site where this is visible. Thank you.

    Posted 11 years ago on Saturday February 9, 2013 | Permalink

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