Barbareshet

wp loop

Jul 26th, 2017
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The main template file
  4.  */
  5.  
  6. get_header();?>
  7. <?php
  8. //standard wp loop
  9.                 if ( have_posts() ) :
  10.  
  11.                     if ( is_home() && ! is_front_page() ) : ?>
  12.                         <header>
  13.                             <h1 class="page-title "><?php the_title(); ?></h1>
  14.                         </header>
  15.  
  16.                         <?php
  17.                     endif;
  18.  
  19.                     /* Start the Loop */
  20.                     while ( have_posts() ) : the_post();
  21.  
  22.                         /*
  23.                          * Include the Post-Format-specific template for the content.
  24.                          * If you want to override this in a child theme, then include a file
  25.                          * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  26.                          */
  27.                         get_template_part( 'template-parts/content', get_post_format() );
  28.  
  29.                     endwhile;?>
  30.  
  31.                     <div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div>
  32.                     <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>
  33.  
  34.              <?php   else :
  35.  
  36.                     get_template_part( 'template-parts/content', 'none' );
  37.  
  38.                 endif; ?>
  39.  
  40. <?php get_footer();
Advertisement
Add Comment
Please, Sign In to add comment