Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.