How to change post count shown in wordpress loop?

Hey I am attempting to customize my wordpress post loop to create different post style for a certain set of post.

For example the first three post would be styled in it’s own way, the next four post will be style in it’s own way and etc.

In addition to that I want to add

breaks after a certain amount of post. See image below for what I am trying to accomplish.

http://cdn.ratedrnb.com/2016/04/photo.png

Now this code below is what I use to style the post differently.

<?php if (have_posts()) :
$count = 0;

// What page are we on?
$paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;
// How many pages of posts do we have to display?
//$max = $wp_query->max_num_pages;

while (have_posts()) : the_post();      

$count++;

if ($count  == 1 && $paged == 1) : ?> 

 <!--first post -->

 **html/style of the first post**

 <!--next four post -->

 <?php elseif ($count  > 1 && $count  <5 && $paged == 1) : ?>

 **html/style of next four post**

 <!-- 4th post and break div -->

<?php elseif ($count  == 5 && $paged == 1) : ?> 

**html/style of fourth post**

<div>This is the div break</div>

<!--next five post -->

 <?php elseif ($count >5 && $count < 11 && $paged == 1) : ?> 

**html/style of next six post**

<!--sixth post and div break-->

 <?php elseif ($count == 11 && $paged == 1) : ?>

**html/style of 6th post**

 <div>This is the div break</div>

 <!--last eight post-->

<?php elseif ($count  > 12 && $count  < 21 && || $paged == 1) : ?>

**html/style of last eight post**

  <?php endif;
endwhile;
endif; ?>

Now this code is also designed so that when I go to the next page the rest of the pages takes the style of the last eight post.

Can anyone explain to me how to change this line below to show the first 3 post instead of just one.

<?php if (have_posts()) :
$count = 0;

// What page are we on?
$paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;
// How many pages of posts do we have to display?
//$max = $wp_query->max_num_pages;

while (have_posts()) : the_post();      

$count++;

if ($count  == 1 && $paged == 1) : ?> 

Also can anyone explain to me why the person I hired to do this had to separate the loop like below.

 <!--next four post -->

 <?php elseif ($count  > 1 && $count  <5 && $paged == 1) : ?>

 **html/style of next four post**

 <!-- 4th post and break div -->

<?php elseif ($count  == 5 && $paged == 1) : ?> 

**html/style of fourth post**

<div>This is the div break</div>

Hi, I am trying to customize my loop as to where I can add sections between posts on my homepage as well as style each set of posts differently. The link below shows exactly what I am trying to accomplish.

http://cdn.ratedrnb.com/2016/04/photo.png

Notice how the first three post are all styled the same. In the next section under those three post there is a large image on the left, that is the thumbnail that goes to the first post right of that image. After that there is a section in which I will add special content.

After that there are 6 more post and to the right of that is the sidebar. After that another section for special content. Then six more post, then the last six post. When the user clicks read more I don’t want the entire loop to repeat I want the paged post to take the style of the last six post.

I need help trying to get the php code that I am currently using to work with this design. I have tried for 3 months to get this right, which lead to me hiring a developer whom flaked on me. I then proceeded to hire another developer whom made everything look perfect but the loop didn’t function right at all and that developer ran off with the money I paid him.

I have been trying to get this for 3 month and haven’t had luck. I come here in hopes of the many developers on this site could help me to achieve my goal.

Below is code that I use to style the post differently, I need help figuring out how to code the second section (next 4 post) as seen in the photo and adding the <div> sections as well.

<?php if (have_posts()) :
$count = 0;

// What page are we on?
$paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;
// How many pages of posts do we have to display?
//$max = $wp_query->max_num_pages;

while (have_posts()) : the_post();      

$count++;

if ( $count <=3 && $paged ==1): ?> 

 <!--first three post -->

 **html/style of the first post**

 <!--next four post -->

 <?php elseif ($count  > 3 && $count  <7 && $paged == 1) : ?>

 **html/style of next four post**

<!--next six post -->

 <?php elseif ($count >7 && $count < 13 && $paged == 1) : ?> 

**html/style of next six post**

 <!--next six post-->

 <?php elseif ($count >13 && $count < 19 && $paged == 1) : ?> 

**html/style of next six post**

 <!--last six post-->

<?php elseif ($count  > 19 && $count  < 25 && || $paged == 1) : ?>

**html/style of last six post**

  <?php endif;
endwhile;
endif; ?>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.