This question shows research effort; it is useful and clear
0
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
I am doing a theme with a 4x4 grid layout in Wordpress. I am planning to have the fourth block (1st column, 4th row) to display an ad. Can this be done in the post loop? The 4th block is not a post type, it will be and custom html div block.
$count = 1;
while (have_posts()) {
if ($count % 4 > 0) {
the_post();
} else {
//display the ad
//put your ad code here
//then start a new row in your grid and display the post
the_post();
}
$count++;
}