Display posts from a specific category in the sidebar
-
Hello,
I’ve seen numerous posts here about this issue, but none have had a clear answer that works. What I’d like to do is display, in my sidebar, a list of posts from 1 specific category. Of course I’d like to also be able to control how many posts are listed, and have the titles be clickable to each post.
Someone in another thread posted the following code, which *almost* works, but spits back a syntax error when I try to use it:
<ul> <?php global $post; $myposts = get_posts('numberposts=5&offset=1&category=1'); foreach($myposts as $post) : setup_postdata($post); ?> <li><a>"><?php the_title(); ?></a> </li> </ul>
Any ideas of how to modify the above to my needs, or, alternately, a different method altogether?
Thanks much.
-ben
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Display posts from a specific category in the sidebar’ is closed to new replies.