Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

opoz1 on "Block random writes"

$
0
0

Hi I have a problem:
Infer block random writes code

<?php
     $MyArgs = array(
    'orderby' => 'rand',   // Способ сортировки: случайным образом.
    'showposts' => '2',  // Покажем лишь 5 записей. Можете и 10, и 17 вписать.
    'cat' => '2'  // Включаем только записи из рубрики с идентификатором, равным 6
  );
  query_posts($MyArgs); // Передаем параметры, заданные в массиве $args
  if (have_posts()) : // Далее идет типичный цикл вывода "постов".
    while (have_posts()) : the_post(); ?>           

                <h6 class="p2"><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h6>
               <div class="border padd-1">
           <?php the_excerpt(); ?>
              <a class="btn-1" href="<?php echo get_permalink(); ?>">Подробнее</a>
              </div>
<?php

how to make that <div class="border padd-(Assigning a serial number from 1 to2) \">

MMR at the last engine was so <div class="border padd-{% if(alternating == 'odd') %}1 {% else %}2 {% endif %} ">


Viewing all articles
Browse latest Browse all 8245

Trending Articles