Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 43 additions & 39 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,49 @@
if ( have_posts() ) :
?>
<div class="container">
<?php
if ( is_home() && ! is_front_page() ) {
?>
<header class="mb-5">
<h1 class="page-title screen-reader-text">
<?php single_post_title(); ?>
</h1>
</header>
<?php
}
?>

<div class="row">
<?php
$index = 0;
$no_of_columns = 3;

while ( have_posts() ) : the_post();

if ( 0 === $index % $no_of_columns ) {
?>
<div class="col-lg-4 col-md-6 col-sm-12">
<?php
}

get_template_part( 'template-parts/content' );

$index ++;

if ( 0 !== $index && 0 === $index % $no_of_columns ) {
?>
</div>
<?php
}

endwhile;
?>
</div>
</div>

<?php
if (is_home()) {
?>
<header class="mb-5">
<h1 class="page-title">
<?php single_post_title(); ?>
</h1>
</header>
<?php
}
?>

<?php
$index = 0;
$no_of_columns = 3;

while (have_posts()) : the_post();

if (0 === $index % $no_of_columns) {
?>
<div class="row">
<?php
}
?>
<div class="col-lg-4 col-md-6 col-sm-12">
<?php
get_template_part('template-parts/content');
?>
</div>
<?php
$index++;

if (0 !== $index && 0 === $index % $no_of_columns) {
?>
</div>
<?php
}

endwhile;
?>

</div>
<?php

else :
Expand Down