<?php // przykladowe wykorzystanie petli
$loop = new WP_Query(array( // petla z zawezonym wyszukiwaniem
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'ingredients',
'field' => 'slug',
'terms' => $ingredients
)
)
));
if($loop -> have_posts()) :
while($loop -> have_posts()) : $loop -> the_post();
?>
<section id=recipe-"<?php the_ID(); ?>" <?php post_class('entry'); ?>> <!-- ID / class='entry' -->
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> <!-- link / miniaturka -->
<h2><a href="<?php the_permalink(); ?>"><?php echo the_title() ?></a></h2> <!-- link / tytul -->
<a class="more" href="<?php the_permalink(); ?>">...</a> <!-- link -->
</section>
<?php endwhile; ?>
<?php else: ?>
<h4>Brak postow</h4>
<?php endif; ?>
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.