<?php query_posts( array('cat'=>2, 'paged'=>get_query_var('paged'), 'posts_per_page'=>'5' ) ); ?>
<?php //query_posts('cat=2&posts_per_page=2'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; ?>
<?php posts_nav_link(' • ','«Prev','Next»'); ?>
<?php else: ?>
<?php endif; wp_reset_query(); ?>
<form method="get" action="<?php bloginfo('url'); ?>">
<fieldset>
<input type="text" name="s" value="" placeholder="search…" maxlength="50" required="required" />
<select name="tag">
<?php
// генератор списка меток
$tags = get_tags();
foreach ($tags as $tag) {
echo '<option value="', $tag->slug, '">', $tag->name, "</option>\n";
}
?>
</select>
<button type="submit">Поиск</button>
</fieldset>
</form>
<?php
$card = new WP_Query( array( 'post_type' => 'card') );
if ( $card->have_posts() ) :
while ( $card->have_posts() ) : $card->the_post(); ?>
<div class="card">
<h2><?php the_title(); ?></h2>
<p><? the_content(); ?></p>
</div>
<?php endwhile; ?>
<?php endif; ?>