using get_posts(‘$category_name=blahblah’)
-
Hi,
I want to configure the sidebar to list certain posts by their category name under a new sidebar header. I’m using the following code, but it lists all posts regardless of the category name they’ve been given:- <h2>Posts</h2>
-
<?php
- ” id=”post-<?php the_ID(); ?>”><?php the_title(); ?>
$postslist = get_posts(‘$category_name=Posts’);foreach ($postslist as $post):
setup_postdata($post);
?><?php
endforeach; ?>Anyone know how to fix this?
Thanks,
Will
- <h2>Posts</h2>
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for WordPress.com hosted blogs only. If you have a self-hosted WordPress blog you need to seek help at the WordPress.org forums, not here.
If you don’t understand the difference, you may find this information helpful.
-
-
Will, since your blog is self-hosted, follow the link in Sam’s post about the wordpress.ORG forums which is where self-hosted blogs are supported.
- The topic ‘using get_posts(‘$category_name=blahblah’)’ is closed to new replies.