Skip to content

Instantly share code, notes, and snippets.

@Netzberufler
Created November 10, 2016 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Netzberufler/c00dabee598c7a77a88fa0a7496e905e to your computer and use it in GitHub Desktop.
Save Netzberufler/c00dabee598c7a77a88fa0a7496e905e to your computer and use it in GitHub Desktop.
Grid Layout mit Flexbox: WordPress Loop
<?php
/**
* The template for displaying archive pages
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
</header><!-- .page-header -->
<div class="post-wrapper">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content' );
endwhile;
?>
</div>
<?php endif; ?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php
/**
* The template part for displaying content
*/
?>
<div class="post-column">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
</header><!-- .entry-header -->
<?php the_post_thumbnail(); ?>
<div class="entry-content">
<?php the_content( esc_html__( 'Read more', 'theme-slug' ) ); ?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment