Last active
August 23, 2021 11:38
-
-
Save remcotolsma/326a14204a8146b2cf46 to your computer and use it in GitHub Desktop.
WordPress query loop in multiple Bootstrap columns and rows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>FITsociety</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-9"> | |
<?php if ( have_posts() ) : the_post(); ?> | |
<div class="well"><h2><?php the_title(); ?></h2></div> | |
<?php endif; ?> | |
</div> | |
<div class="col-md-3"> | |
<?php $i = 0; while ( have_posts() && $i++ < 2 ) : the_post(); ?> | |
<div class="well"><h2><?php the_title(); ?></h2></div> | |
<?php endwhile; ?> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-9"> | |
<div class"row"> | |
<?php $i = 0; while ( have_posts() && $i++ < 4 ) : the_post(); ?> | |
<div class="col-md-6"> | |
<div class="well"><h2><?php the_title(); ?></h2></div> | |
</div> | |
<?php endwhile; ?> | |
</div> | |
<div class"row"> | |
<div class="col-md-12"> | |
<div class="well"><h2>Banner/widget</h2></div> | |
</div> | |
</div> | |
</div> | |
<div class="col-md-3"> | |
<div class="well"><h2>Banner/widget</h2></div> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-4"> | |
<div class="well"><h2>Banner/widget</h2></div> | |
</div> | |
<div class="col-md-4"> | |
<div class="well"><h2>Banner/widget</h2></div> | |
</div> | |
<div class="col-md-4"> | |
<div class="well"><h2>Banner/widget</h2></div> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-9"> | |
<div class"row"> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<div class="col-md-6"> | |
<div class="well"><h2><?php the_title(); ?></h2></div> | |
</div> | |
<?php endwhile; ?> | |
</div> | |
<div class"row"> | |
<div class="col-md-12"> | |
<div class="well"><h2>Banner/widget</h2></div> | |
</div> | |
</div> | |
</div> | |
<div class="col-md-3"> | |
<div class="well"><h2>Banner/widget</h2></div> | |
</div> | |
</div> | |
</div> | |
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<!-- Include all compiled plugins (below), or include individual files as needed --> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
amazing amazing