• Resolved permutations

    (@permutations)


    I’m moving pages that were hand-coded in PHP over to live inside a WordPress blog. One of these pages is a questionnaire/poll. It’s all in one file, and depending on whether there’s POST or GET data, it will display either the questionnaire or the results.

    Since there’s a lot of PHP, I did this by creating a single-page template that includes the file poll.php. I based it on the page.php file for my template. I’m pretty sure this isn’t a template-specific issue, though. The code is very simple:

    <?php
    /*
    Template Name: Poll
    Template Post Type: page
    */
    get_header(); // WordPress header
    ?>
        <div id="container" class="<?php echo kahuna_get_layout_class(); ?>">
        
            <main id="main" role="main" class="main">
                <?php cryout_before_content_hook(); ?>
                <?php get_template_part( 'content/content', 'page' ); ?>
                
                <?php // my code
                require_once($_SERVER['DOCUMENT_ROOT'].'/pages/poll.php');
                ?>
                   
                <?php cryout_after_content_hook(); ?>
            </main><!-- #main -->
        
            <?php kahuna_get_sidebar(); ?>
        </div><!-- #container -->
    <?php get_footer();

    My layout has a header and two sidebars. The poll page looks fine when it’s first loaded, but when the form is submitted, the results are displayed with only the header – no sidebars.

    I can’t figure out why it doesn’t display the same way when the form is submitted. It’s returning to the same page, same code.

    Can anyone help me?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘WP page loses sidebars after form submitted’ is closed to new replies.