Temanizin loop kismini sununla degistirip istediginiz gibi oynayabilirsiniz:
<ul class="grid-wrap">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li class="grid-item">
<p>
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'large' ); ?></a>
<?php endif; ?>
</p>
<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p class="author-text">Posted on <?php echo the_time('F jS, Y');?> by <?php the_author_posts_link(); ?> </p>
<?php the_excerpt(); ?>
<?php endwhile; ?>
<?php endif; ?>
</li>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>></div>
</ul>Style.css'ye de bunu ekleyin:
.grid-wrap {
display: flex;
flex-flow: row wrap;
align-items: center;
justify-content: center;
list-style: none;
}
.grid-item {
flex-basis: 400px;
height: 500px;
padding: 10px;
margin: 10px;
}
.grid-item img {
display: block;
margin-left: auto;
margin-right: auto;
max-width: 400px;
}
.grid-wrap ul {
margin-left: 0;
}