Skip to content

Instantly share code, notes, and snippets.

@agragregra
Created February 17, 2015 20:54
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 18 You must be signed in to fork a gist
  • Save agragregra/9a2ed85f0f65ad054a76 to your computer and use it in GitHub Desktop.
Save agragregra/9a2ed85f0f65ad054a76 to your computer and use it in GitHub Desktop.
<?php
if ( have_posts() ) : // если имеются записи в блоге.
query_posts('cat=3'); // указываем ID рубрик, которые необходимо вывести.
while (have_posts()) : the_post(); // запускаем цикл обхода материалов блога
?>
<?php the_post_thumbnail(array(100, 100)); ?>
<? endwhile; // завершаем цикл.
endif;
/* Сбрасываем настройки цикла. Если ниже по коду будет идти еще один цикл, чтобы не было сбоя. */
wp_reset_query();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment