This widget displays posts in the category, order, and quantity of your choosing. It supports custom templates!
After installation, drag-and-drop the new “Category Widget” to a widget area, choose the categories you wish to display, and tell it the order and quantity in which you wish to display them.
The default template is just plain-ol’ HTML5, without any CSS; it’s meant to fit right into any theme without modification.
However, if you’re a theme developer and you wish to use custom markup or WP functions inside your template, here’s how to customize it:
catswidget.php
(or copy template.php
from posts-by-cat-widget/views
to your theme’s root, and rename it catswidget.php
, if you’d rather use the default as a starting point).$posts
variable, like this:if ( $posts -> have_posts() ) :
while ( $posts -> have_posts() ) :
$posts -> the_post(); ?>
// Your markup here
endwhile;
endif;