Adding specific category into an existing query
-
Here is the code to show the “Latest News” posts on my home page.
<?php if ( of_get_option(‘gg_headlines’) ) {
$query = new WP_Query( );
$post_number = of_get_option(‘gg_headlines’);
$query->query(‘posts_per_page=’ . $post_number);
while ($query->have_posts()) : $query->the_post();
?>I would like to have my home page only show category 4 (Latest News) and not all categories on my blog. How do I go about adding cat=4 in this code?
Thanks in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding specific category into an existing query’ is closed to new replies.