Display Posts by Category [shortcode]

Suppose we want to display a list of post links in the sidebar that are in “child” categories of the “News” category (ie “Boating News” followed by its posts, “Fishing News” followed by its posts, in this case from the last 90 days because of the filter). We could include this code in functions.php:

Then in a sidebar text widget we would insert:

This would display all category titles which are children of category with the id of 3, with the 3 newest posts (less than 90 days old) for each category. Of course we could change the category and number displayed by changing the arguments in the shortcode.