Advertisement
Guest User

Untitled

a guest
Sep 25th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php get_template_part( 'template-parts/masthead' ); ?>
  3. <div id="content">
  4. <?php
  5. $recent_posts = wp_get_recent_posts( array( 'numberposts' => 1 ) );
  6. ?>
  7. <?php if ( $paged < 2 ) : ?>
  8. <?php
  9. the_archive_description( '<div class="article-description">', '</div>' );
  10. ?>
  11. <div class="container">
  12. <div class="row">
  13. <main class="col-sm-12 col-md-10 offset-md-1 articles">
  14. <?php if ( have_posts() ) : ?>
  15. <header class="article-header">
  16. <?php
  17. the_archive_title( '<h1 class="article-title"><span>', '</span></h1>' );
  18. ?>
  19. </header>
  20. <?php
  21. while ( have_posts() ) :
  22. if( $recent_posts[0]->ID == get_the_ID() ) continue;
  23. the_post();
  24. get_template_part( 'template-parts/content', get_post_type() );
  25. endwhile;
  26. else :
  27. get_template_part( 'template-parts/content', 'none' );
  28. endif;
  29. ?>
  30. <?php get_template_part( 'template-parts/post-nav' ); ?>
  31. </main>
  32. </div>
  33. </div>
  34. <?php else : ?>
  35. <div class="container">
  36. <div class="row">
  37. <main class="col-sm-12 col-md-10 offset-md-1 articles">
  38. <?php if ( have_posts() ) : ?>
  39. <header class="article-header">
  40. <?php
  41. the_archive_title( '<h1 class="article-title"><span>', '</span></h1>' );
  42. ?>
  43. </header>
  44. <?php
  45. while ( have_posts() ) :
  46. the_post();
  47. get_template_part( 'template-parts/content', get_post_type() );
  48. endwhile;
  49. else :
  50. get_template_part( 'template-parts/content', 'none' );
  51. endif;
  52. ?>
  53. <?php get_template_part( 'template-parts/post-nav' ); ?>
  54. </main>
  55. </div>
  56. </div>
  57. <?php endif; ?>
  58. </div>
  59. <?php
  60. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement