WordPress does what he wants with my classes, dont know what to do the result should look like on almalavinia.com homepage.
Any advice or idees on how and what to change to make WordPress respect my divs.

[<?php if (have_posts()) : ?>
<?php $count = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>
<?php if ($count == 1) : ?>

   <div class="container-fluid">
         <div class="row col-height marg">
            <div class="col-md-6 col-sm-6 col-height col-padding">
               <div class="main-post">
                  <a href="<?php the_permalink(); ?>">
                     <?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>

  <figure style="background: url('<?php echo $backgroundImg[0]; ?>'); background-position: center;overflow: hidden;background-size: 1700px 668px;background-attachment: fixed"></figure>
                     <div class="description-main">
                        <div class="row ">
                           <div class="col-md-5">
                              <h1><?php the_title(); ?></h1>
                           </div>
                           <div class="col-md-7 ">
                              <h3><?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?>
</h3>
                              <span>Read More <i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i></span>
                           </div>
                        </div>
                     </div>
                  </a>
               </div>
            </div>

<?php elseif ($count == 2) : ?>      


            <div class="col-none">
               <div class=" col-padding col-md-3 col-sm-3  col-height">
                  <div class="second-post">
                     <a href="https://i0.wp.com/almalavinia.com/wp-content/uploads/2017/02/20160710_174724.png?resize=1024%2C576">
                         <?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>

  <figure style="background: url('<?php echo $backgroundImg[0]; ?>'); background-position: center;overflow: hidden;background-size: 1700px 668px;background-attachment: fixed"></figure>

                           <div class="roww">
                           <div class="description description-padding">
                              <div class="figcaption text-in-figcaption">
                                 <h2><?php the_title(); ?></h2>
                                 <p><?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?></p>
                              </div>
                           </div>
                        </div>
                     </a>
                  </div>

<?php elseif ($count == 3) : ?> 

                   <div class="third-post">
                     <a href="https://i0.wp.com/almalavinia.com/wp-content/uploads/2017/02/20160710_174724.png?resize=1024%2C576">

                            <?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>

  <figure style="background: url('<?php echo $backgroundImg[0]; ?>'); background-position: center;overflow: hidden;background-size: 1700px 668px;background-attachment: fixed"></figure>

                        <div class="roww">
                           <div class="description">
                              <div class="figcaption text-in-figcaption">
                                 <h2><?php the_title(); ?></h2>
                                 <p><?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?></p>
                              </div>
                           </div>
                        </div>
                     </a>
                  </div>
               </div>



<?php elseif ($count == 4) : ?>  

   <div class="col-md-3 col-sm-3 col-padding-third col-padding col-height">
                  <div class="fourth-post">
                     <a href="https://i0.wp.com/almalavinia.com/wp-content/uploads/2017/02/20160710_174724.png?resize=1024%2C576">
                        <?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>

  <figure style="background: url('<?php echo $backgroundImg[0]; ?>'); background-position: center;overflow: hidden;background-size: 1700px 668px;background-attachment: fixed"></figure>

                        <div class="roww">
                           <div class="description description-padding">
                              <div class="figcaption text-in-figcaption">
                                 <h2><?php the_title(); ?></h2>
                                 <p><?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?></p>
                              </div>
                           </div>
                        </div>
                     </a>
                  </div>

<?php elseif ($count == 4) : ?>  

                  <div class="fifth-post">
                     <a href="https://i0.wp.com/almalavinia.com/wp-content/uploads/2017/02/20160710_174724.png?resize=1024%2C576">

 <?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>

  <figure style="background: url('<?php echo $backgroundImg[0]; ?>'); background-position: center;overflow: hidden;background-size: 1700px 668px;background-attachment: fixed"></figure>

                        <div class="description">
                           <div class="figcaption text-in-figcaption">
                              <h2><?php the_title(); ?></h2>
                              <p><?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?></p>
                           </div>
                        </div>
                     </a>
                  </div>
               </div>
            </div>
         </div>
      </div>



<?php else : ?>


 <div class="container1 clearfix">
         <div class="col-lg8 col-md-8 col-sm-12 col-xs-12">
<div class="row row-xs"><!-- row -->

            <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
   <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"><!-- col-lg-6 -->
                  <div class="article"><!-- carticle -->

            <!-- post thumbnail -->
            <div class="article-img"><!-- article-img -->


<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">


                           <div class="img-responsive articol-1"> <!-- img-responsiv -->  
               <?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>   
<?php the_post_thumbnail(array(435,372)); // Declare pixel size you need inside the array ?>
</div><!-- /img=resposnive -->
         </a>

</div>   <!-- /article-img -->         

<div class="article-description"><!-- ariticle-description -->


<div class="text-description asiatic"><!-- descript asiatic -->
<!-- post title -->
<p class="asia" id="europa">

<a class="categori " hreff="#"  <?php the_category( ' ' );?> </a>

</p>


                           <h3>
<a href="<?php the_permalink(); ?>"  title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h3>

      <!-- /post title -->

 </div><!-- /decript asiatic -->

      <?php endif; ?>
      <!-- /post thumbnail -->


      <?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?>

   <!-- post details -->




      <div class="time">
      <span class="date"><?php the_time('F j, Y'); ?> <?php the_time('g:i a'); ?></span>
      <span class="author"><?php _e( 'by', 'html5blank' ); ?> <?php the_author_posts_link(); ?></span>
      <a href="https://www.facebook.com/sharer/sharer.php?u=http%3A//almalavinia.com/africa/morocco-travel-tips/" class="btn btn-default btn-share" role="button"> <span class="glyphicon glyphicon-share" aria-hidden="true"></span></a>
</div><!-- 6 -->

      <span class="comments"><?php if (comments_open( get_the_ID() ) ) comments_popup_link( __( '', 'html5blank' ), __( '1 Comment', 'html5blank' ), __( '% Comments', 'html5blank' )); ?></span>
      <!-- /post details -->


</div><!-- ariticle-description -->
</div>
<!-- /carticle -->
<?php edit_post_link(); ?>
</div>
<!-- /col-lg -->



   </article>
</div> <!-- /Row-xs -->
<?php get_template_part('pagination'); ?>
</div> <!-- /col pt articol-->
<?php get_sidebar(); ?>
</div> <!-- /wraper -->

  <?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>][1]

Read more here: WordPress doesnt respect the divs. My code should look like : almalavinia.com.


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: