Change Loop to Show Recent Posts Only from 1 Category
-
Hi,
I’m using a custom widget to display a listing of recent posts.
However, I’d like to only show the posts from a particular category, offset by one, as that story will be featured in the slider above the widget.
Here is my current query code (for this one I’d like to pick the category with the offset):
<?php $recent = new WP_Query('showposts=' . $post_num . ' '); while($recent->have_posts()) : $recent->the_post();?>
Also, I’d like to offset it by one here as well, but the category calls are already in place:
<?php $recent = new WP_Query(array( 'category_name' => ' ' . $category2 . ' ', 'showposts' => '1' )); while($recent->have_posts()) : $recent->the_post();?>
Thanks for the help!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Change Loop to Show Recent Posts Only from 1 Category’ is closed to new replies.