Custom page template with sidebar
-
Hello guys, I hope that you can help me with this since I am going crazy.
I have a child theme of the zerif lite one. I need to create a PAGE template with the sidebar on the right. I did that but the sidebar is always on the bottom of the page.
I can confirm you that I read all the topics about that on this forum, I do use the search function, I have already used validator.w3.org and there are no errors.
If I select the page template Blog the sidebar is in the right place but of course the page will show just the post and not the page content. If I select mine instead the content is in there and the sidebar on the bottom.
There is no open <div>. I don’t know what else should I check. I read the WordPress documentation about how to create a custom page template but I wasn’t lucky with that.
Please find as attachment my file:
<?php /** * Template Name: Sidebar */ get_header(); ?> <div class="clear"></div> </header> <!-- / END HOME SECTION --> <div id="content" class="site-content"> <div class="container"> <div class="content-left-wrap col-md-12"> <div id="primary" class="content-area"> <main id="main" class="site-main"> <?php while ( have_posts() ) : the_post(); get_template_part( 'content', 'page' ); // If comments are open or we have at least one comment, load up the comment template if ( comments_open() || '0' != get_comments_number() ) : comments_template(); endif; endwhile; ?> </main><!-- #main --> </div><!-- #primary --> </div><!-- .content-left-wrap --> </div> <div id="sidebar"> <?php get_sidebar(); ?> </div><!-- .sidebar-wrap --> </div><!-- .container --> <?php get_footer(); ?>
- The topic ‘Custom page template with sidebar’ is closed to new replies.