afsarwebdev

WP Page Creation

Oct 1st, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /***** Create page.php in WordPress *****/
  2.  
  3. ---write the following code between the main div of theme like wrapper/maincontent---
  4. <?php get_header(); ?>
  5.  
  6. <div id="primary" class="content-area">
  7. <main id="main" class="site-main" role="main">
  8.  
  9. <?php
  10. // Start the loop.
  11. while ( have_posts() ) : the_post();
  12.  
  13. // Include the page content template.
  14. get_template_part( 'content', 'page' );
  15.  
  16. // If comments are open or we have at least one comment, load up the comment template.
  17. if ( comments_open() || get_comments_number() ) :
  18. comments_template();
  19. endif;
  20.  
  21. // End the loop.
  22. endwhile;
  23. ?>
  24.  
  25. </main><!-- .site-main -->
  26. </div><!-- .content-area -->
  27.  
  28. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment