This comes straight from the codex
according to the codex, that code should list the posts of category 1 but nothing shows up. Does this have to be inside the_loop() ?Code:<?php global $post; $args = array( 'numberposts' => 5, 'offset'=> 1, 'category' => 1 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?>


Reply With Quote
Bookmarks