$args = array(
'post_type' => 'doctors-and-staffs',
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page' => -1,
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
$count = 0;
$group = 0;
echo "<div class="staffsColumns">";
while ( $the_query->have_posts() ) {
$the_query->the_post();
$stafftURL= get_permalink();
$staffTitle = get_the_title();
$content = get_the_excerpt();
$subtitle = get_field('sub_title_of_doctor_or_stuff');
$content= substr($content,0,150);
$src = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'staffs-thumb' );
$url = $src[0];
if ($count % 2 == 0) {
$group++;
echo "<div class="et_pb_row block_wrapper wrapper_$group">";
}
echo "<div class="et_pb_column et_pb_column_1_2">
<a class="staff_img" href="https://stackoverflow.com/questions/73004887/$stafftURL">
<img src="$url" class="img-responsive" alt="" />
</a>
<div class="staffInfo">
<a href="https://stackoverflow.com/questions/73004887/$stafftURL">
<h2>$staffTitle</h2>
<p>$subtitle</p>
<h5>View Profile</h5>
</a>
</div>
</div>";
if ( $count % 2 != 0 ) {
echo "</div>"; //block_wrapper
}
$count++;
}
if ( $count % 2 != 0 ) {
echo "</div>"; //block_wrapper
}
echo "</div>";
}
else {
echo "<div class="notAvail">No staffs available</div>";
}
wp_reset_postdata();?>
El código anterior muestra publicaciones en dos columnas, quiero que se muestre en 3 columnas.
¿Hay alguna forma de mostrar la publicación en 3 columnas para que haya 3 columnas?
.