Skip to content

Instantly share code, notes, and snippets.

@stevenspads
Created July 7, 2016 16:05
Show Gist options
  • Save stevenspads/8b45af86565cbbe8158641f902a14ffa to your computer and use it in GitHub Desktop.
Save stevenspads/8b45af86565cbbe8158641f902a14ffa to your computer and use it in GitHub Desktop.
WordPress basic Archive page loop
<?php
if ( have_posts() ) : ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' );
?>
</header>
<?php
while ( have_posts() ) : the_post();
get_template_part( 'includes/content/content', get_post_format() );
endwhile;
else :
get_template_part( 'includes/content/content', '404' );
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment