0

So I activated my custom made theme, which was working fine, with all the animation and everything, but body content was displaying the wrong elements. It was displaying all the standard widgets, like recent posts, etc. I went to customiser to delete it all and was left with blank body section. But my theme was still supposed to display some paragraphs and register form, which wasn't working. Finally I deleted all the pages in dashboard and after publishing changes, my full theme showed up, but now there is no footer and animation aren't working on the page anymore. No errors either. I don't understand what causes this weird behaviour. I work with index.php file in the theme folder by the way.

I tried to restore back all the pages and publish, but now it still doesn't display footer for my home page even after reseting back all the settings in dashboard. I'm totally lost.

My question is, why before removing all the pages at dashboard, my index.php was displaying all the header and footer, but no body content, but after removing pages, I get header, body content I want but no footer and broken animations?

Page.php

get_header(); ?>

    <div id="primary" class="content-area">
        <main id="main" class="site-main">

            <?php
            while ( have_posts() ) : the_post();

                get_template_part( 'template-parts/content', 'page' );

                // If comments are open or we have at least one comment, load up the comment template.
                if ( comments_open() || get_comments_number() ) :
                    comments_template();
                endif;

            endwhile; // End of the loop.
            ?>

        </main><!-- #main -->
    </div><!-- #primary -->

<?php
get_sidebar();
get_footer();

index.php

get_header(); ?>

    <div id="primary" class="content-area">
        <main id="main" class="site-main">

        <div class="container">
            <div class="row">
                <div class="pastumti">
                    <div class="about col-xl-6 col-lg-6 col-sm-12">
                    <h1>About</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                         Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
                         in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
                         sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

                </div>
                <div class="rules col-xl-6 col-lg-6 col-sm-12">
                    <h1>Rules</h1>
                    <ul>
                        <li>1</li>
                        <li>2</li>
                        <li>3</li>
                        <li>4</li>
                    </ul>

                </div></div>


            </div>

        </div>

        <div id="register" class="register">
            <div class="container dydis">
                    <div class="row">
                        <div class="col-lg-12 cen">
                                <div class="regform">
                                    <div class="forma">
                                        <h2 style="text-align: center; color: #E45E5D; font-weight: 700;">Register for quiz</h2>
                                        <form action="index.php" method="post">
                                        <input type="text" placeholder="Enter Email" name="email_contact" required>
                                        <input type="text" placeholder="Enter full name" name="fullname_contact" required>


                                    </div>
                                         <button type="submit" name="submit_contact" class="signupbtn">Start quiz</button>
                                     </form>
                                     <?php
                                     if (isset($_POST['submit_contact'])) {
                                       $email = $_POST['email_contact'];
                                       $full = $_POST['fullname_contact'];
                                       global $wpdb;
                                        $result = $wpdb->get_results('SELECT email FROM `wp_register`');
                                        foreach ($result as $key) {
                                            $key->email;
                                        };
                                        if ($key->email == $email) {
                                            exit();
                                        }else {
                                            $wpdb->insert('wp_register', array('name' => $full, 'email' => $email));
                                            header:("Location: index.php?success");
                                        }

                                       }else {
                                       exit();
                                     }

                                      ?>


                                </div>




                        </div>
                    </div>
            </div>

        </div>

        </main><!-- #main -->
    </div><!-- #primary -->

<?php
get_sidebar();
get_footer();

footer.php

<footer id="contacts">
    <div class="footer" id="footer">
        <div class="container">
            <div class="row">
                <div class="col-lg-2  col-md-2 col-sm-4 col-xs-6">
                    <h3> Site Map </h3>
                    <ul>
                                            <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', 'okindk' ); ?></button>
                                            <?php
                                                wp_nav_menu( array(
                                                    'theme_location' => 'menu-1',
                                                    'menu_id'        => 'primary-menu',
                                                ) );
                                            ?>
                                        </nav><!-- #site-navigation -->
                    </ul>
                </div>
                <div class="col-lg-2  col-md-2 col-sm-4 col-xs-6">
                    <h3> Contacts </h3>
                    <ul>
                        <li> <a href="#"> Number: 000000 </a> </li>
                        <li> <a href="#"> Email: gerulisjonas1@gmail.com </a> </li>
                        <li> <a href="#"> Address: No tell </a> </li>
                        <li> <a href="#"> CVR: 0000000 </a> </li>
                    </ul>
                </div>
                <div class="col-lg-2  col-md-2 col-sm-4 col-xs-6">
                    <h3> Lorem Ipsum </h3>
                    <ul>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                    </ul>
                </div>
                <div class="col-lg-2  col-md-2 col-sm-4 col-xs-6">
                    <h3> Lorem Ipsum </h3>
                    <ul>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                        <li> <a href="#"> Lorem Ipsum </a> </li>
                    </ul>
                </div>
                <div class="col-lg-3  col-md-3 col-sm-6 col-xs-12 ">
                    <h3> Subscribe for news </h3>
                    <ul>
                        <li>
                            <div class="input-append newsletter-box text-center">
                              <form class="" action="includes/email.php" method="post">
                                <input type="text" class="full text-center" placeholder="Email " name="ema">
                                <button name="submit" class="btn  bg-gray" type="submit"> Subscribe <i class="fa fa-long-arrow-right"> </i> </button>

                              </form>

                            </div>
                        </li>
                    </ul>
                    <ul class="social">
                        <li> <a href="#"> <i class=" fa fa-facebook">   </i> </a> </li>
                        <li> <a href="#"> <i class="fa fa-twitter">   </i> </a> </li>
                        <li> <a href="#"> <i class="fa fa-google-plus">   </i> </a> </li>
                        <li> <a href="#"> <i class="fa fa-pinterest">   </i> </a> </li>
                        <li> <a href="#"> <i class="fa fa-youtube">   </i> </a> </li>
                    </ul>
                </div>
            </div>
            <!--/.row-->
        </div>
        <!--/.container-->
    </div>
    <!--/.footer-->

    <div class="footer-bottom">
        <div class="container">
            <p class="pull-left"> Copyright © 2017 Jonas Tamosevicius </p>
        </div>
    </div>
    <!--/.footer-bottom-->

</footer>

</body>
</html>

</div><!-- #page -->

<?php wp_footer(); ?>

</body>
</html>

1 Answer 1

0

that's a long issue though, better will be to upload a screenshot of your code to imgur.com and paste the link here so we can check. Rest make you are calling your footer wp_footer() function, if its having footer.php.

3
  • I updated my original post with some code that I think is relevant.
    – Limpuls
    Dec 9, 2017 at 21:24
  • your footer.php is fully messed up. clean the code you have duplication last lines.add <?php get_footer();?> to index.php. also i don't see any proper opening and closing of header.php write this way: <?php get_header();?> <?php get_sidebar();?> and correct in all three above pages.
    – TheDose
    Dec 9, 2017 at 21:43
  • I think wp_footer() is necessary for footer.php file? The actual problem was my exit() function in index.php breaking all animations, I don't know why. Regarding the footer, it was some CSS problems. Now it all works. But you are right, the footer is real mess and i'm going to clean it up. And for the opening and closing tags, they are there, I might just missed them when copying the code. Thanks for the help.
    – Limpuls
    Dec 9, 2017 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.