Спасибо за просмотр моего вопроса. У меня есть шаблон, который отображает сообщения в блоке 3 на 3, я пытаюсь расширить его до 4 на 3, как мне это сделать? Мне удалось создать дополнительную строку внизу, но мне нужен дополнительный столбец
Код в вопросах находится здесь:
<div class = "col-xs-12 col-sm-9 col-md-9 col-lg-9">
<div class = "row row-adj-gap">
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => 9
);
query_posts( $args );
if ( have_posts() ):
$lp_cntr = 0;
while ( have_posts() ) :
the_post();
$lp_cntr++;
?>
<div class = "col-xs-12 col-sm-4 col-md-4 col-lg-4">
<div class = "hvr-wobble-horizontal full-div">
<a href = "<?php get_date(); ?>" class = "coverBox">
<img src = "<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>" class = "img-responsive" alt = "<?php the_title(); ?>">
<span><i class = "fa fa-braille" aria-hidden = "true"></i><?php the_title(); ?></span>
</a>
<div class = "desp-box">
<?php the_content(); ?>
</div>
</div>
</div>
<?php if ($lp_cntr%3==0): ?>
</div>
<div class = "row row-adj-gap">
<?php endif; ?>
<?php
endwhile;
endif;
wp_reset_query();
?>
</div>






Тебе надо:
col-sm-4, col-md-4 и col-lg-4 становятся col-sm-3, col-md-3 и col-lg-3) и$lp_cntr%3==0 становится $lp_cntr%4==0)См. Скорректированный код ниже:
<div class = "col-xs-12 col-sm-9 col-md-9 col-lg-9">
<div class = "row row-adj-gap">
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => 9
);
query_posts( $args );
if ( have_posts() ):
$lp_cntr = 0;
while ( have_posts() ) :
the_post();
$lp_cntr++;
?>
/* Change the following line to decrease block width: */
<div class = "col-xs-12 col-sm-3 col-md-3 col-lg-3">
<div class = "hvr-wobble-horizontal full-div">
<a href = "<?php get_date(); ?>" class = "coverBox">
<img src = "<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>" class = "img-responsive" alt = "<?php the_title(); ?>">
<span><i class = "fa fa-braille" aria-hidden = "true"></i><?php the_title(); ?></span>
</a>
<div class = "desp-box">
<?php the_content(); ?>
</div>
</div>
</div>
/* Change the following line to increase posts in a row before a break: */
<?php if ($lp_cntr%4==0): ?>
</div>
<div class = "row row-adj-gap">
<?php endif; ?>
<?php
endwhile;
endif;
wp_reset_query();
?>
</div>
просто измените класс столбца col-xs-12 col-sm-4 col-md-4 col-lg-4 в на
col-xs-12 col-sm-3 col-md-3 col-lg-3