Recent posts widget, category specific
-
Hi,
I’m trying to improve my blog. I have two main categories “food” and “life”. On each page I would like to have the most recent posts to that category displayed (maybe as a widget) on the right hand side.
I can currently put in a widget that shows recent posts, but only from both categories.The blog I need help with is: (visible only to logged in users)
-
You can add two Text Widgets, one on each category page, and add the following Display Posts Shortcode to it.
[display-posts category="food"] [display-posts category="life"]Then use Visibility options to display food shortcode only on Food category page and the life shortcode only on Life category page.
By default 10 recent posts are displayed. If you want fewer recent posts ( say, 5) you can add posts_per_page as following:
[display-posts category="food" posts_per_page="5"] [display-posts category="life" posts_per_page="5"]Please feel free to let me know if something is not clear or deosn’t work as expected :-)
-
chaitanyamsv.
Thank you so much. It is all working as I would like!
Awesome.
Thanks again!
- The topic ‘Recent posts widget, category specific’ is closed to new replies.