Вывод статей с разными стилями.
Добрый день. Подскажите новичку.
Как выводить посты с разными стилями?
<div class="container"> <div class="row"> <div class="col-sm col-md-12 col-lg-12 col-xl" style="background-image: url('<?php the_post_thumbnail_url(); ?>');background-size: cover;background-position: 50% 28%;background-color: #afb8bf;height: 360px;"> <div class="slide-textover"> <h2><?php the_title(); ?></h2> <p>Договор о сотрудничестве между Патриаршим советом по культуре, Фондом Гуманитарных Проектов и Российским военно-историческим обществом</p> </div> </div> <div class="col-sm" style="height: 360px;padding: 0;"> <div style="background-image: url('<?php the_post_thumbnail_url(); ?>');background-size: cover;background-position: 50% 28%;background-color: #bdc2c8; height: 180px;"> <div class="slide-textover"> <h2><?php the_title(); ?></h2> </div> </div> <div style="background-image: url('<?php the_post_thumbnail_url(); ?>');background-size: cover;background-position: 50% 28%;background-color: #9daab3; height: 180px;"> <div class="slide-textover"> <h2><?php the_title(); ?></h2> </div> </div> </div> <div class="col-sm-12 col-md-12 col-lg-4 col-xl-3" style="background-image: url('<?php the_post_thumbnail_url(); ?>');background-size: cover;background-position: 50% 28%;background-color: #9a939a;height: 360px;"> <div class="slide-textover"> <h2><?php the_title(); ?></h2> <p>Договор о сотрудничестве между Патриаршим советом по культуре, Фондом Гуманитарных Проектов и Российским военно-историческим обществом</p> </div> </div> </div> </div>
При таком условии получается, что выводится 4 по 4)) Статья одна и та же.
посты нужно выводить в цикле! Циклы
background-size: cover;background-position: 50% 28%;background-color: #afb8bf;height: 360px; - А это нужно делать через - nth-child - CSS
.row .col-sm:nth-child(1) { стили } первый блок .row .col-sm:nth-child(2) { стили } второй блок и тд
or do somesinck like thet. Before replace you may put yor terms