The WordPress Category Posts plugin, version 2.0, has been released and is now available for download via the WordPress Extend Plugin Directory. WordPress Category Posts is a plugin for WordPress that creates a linked list of the posts in a specific category.
Open Source Software, Watershed Studio, WordPress, WordPress Category Posts Plugin, WordPress Plugins
This entry was posted
on Friday, September 5th, 2008 at 12:08 am and is filed under Server Side Software, Watershed News, WordPress, WordPress Plugins.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
September 10th, 2008 at 7:21 am
Hallo, and thank you for this useful plugin. Is it correct, as the source code shows, that the tag wp_cat_posts does not create a list (li and /li) when wrapped like this: (ul)(?php wp_cat_posts(12); ?)(/ul)? I would like to affect each single link with my CSS-dfinitions.
September 10th, 2008 at 9:58 am
Mrs_Brown,
This is currently used as a very basic display of all posts in a specific category and it is not always ideal to force it into a list. (In the future we’ll add that option, as a number of people have requested it.)
To force it into a list you’d change the code to something like this:
echo '';- ID) . '">' . $post->post_title . '
foreach( (array) $posts as $post ) {
echo '
';
}
echo '
';
And of course you could change that to suit your needs.
December 8th, 2008 at 6:45 pm
I like this plugin, you can add some easy to change parmeters in the function call that will help address some of the issues that people are having. Something like
function wp_cat_posts( $catID = 0, $start = '', $end = '', $numberposts = -1, order = 'ASC', orderby = 'title' )
and replace everything in there with variables instead of hard coding it. Could possible help in the advent of adding this information in the admin panel and keep people from editing your file and risking an update messing up their websites.
April 1st, 2009 at 2:26 pm
i find this really great, but i wish it would post the category above it, instead of listing all posts.. is there a way of this?
April 1st, 2009 at 3:00 pm
I guess i ended up answering my own question.
Calling Plugin
plugin code
function wp_cat_posts( $catID = 0 ) {
$catID = (int) $catID;
$category = get_cat_name($catID);
$posts = get_posts(array(‘category’ => $catID, ‘numberposts’ => -1, ‘order’ => ASC, ‘orderby’ => title));
echo ” . $category;
foreach( (array) $posts as $post ) {
echo ‘ID) . ‘”>’ . $post->post_title . ‘‘;
}
echo ”;
}
?>