Good day. I’m trying to get different HTML output for the posts but I don’t understand how to do it, with even odd it’s clear but I have 8 different outputs for example:

<div class='wrapper grid'> 

  <div class='gird-item parent-class-1'> 
    <div class='col__50'> post 1 </div>
  </div>
  <div class='gird-item parent-class-2'> 
    <div class='col__50'> post 2 </div>
  </div>
  <div class='gird-item parent-class-3'> 
    <div class='col__25'> post 3 </div>
  </div>
  <div class='gird-item parent-class-4'> 
    <div class='col__25'> post 4 </div>
  </div>
  <div class='gird-item parent-class-5'> 
    <div class='col__50'> post 5 </div>
  </div>
  <div class='gird-item parent-class-6'> 
    <div class='col__50'> post 6 </div>
  </div>
  <div class='gird-item parent-class-7'> 
    <div class='col__50'> post 7 </div>
  </div>
  <div class='gird-item parent-class-8'> 
    <div class='col__50'> post 8 </div>
  </div>

</div>

I’d appreciate it if you would explain me hot to get it.

Read more here: How to get a different html for posts?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: