get_posts arguments
-
I’m trying to get WP to display infro from the_excerpt is a page, but I can’t make get_posts obey ‘category=5’ to make it only show posts from my “photos” category. It WILL work with ‘numberposts=25’, but not ‘category’, as described in https://codex.www.ads-software.com/Template_Tags/get_posts. Why?
<?php
$posts = get_posts('numberposts=25');
foreach($posts as $post) :
setup_postdata($post);
?>
<div id="post">
<div class="thumb">
<a href="<?php the_permalink(); ?>" title=""><?php the_excerpt(); ?></a>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<h4><?php the_time('M jS, Y') ?></h4>
</div>
</div>
<?php endforeach; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_posts arguments’ is closed to new replies.