Display list of recent posts and latest posts or random posts using the [recentposts-sc] shortcode in any page or in sidebar widgets.
The “Recent Posts Shortcode & Widget” helps users to easily display latest posts in a page or in sidebar by just using simple shortcode [recentposts-sc]
By default it displays “latest posts” or “recent posts” which can be changed to display “random posts”, display by ‘title’ etc using ‘orderby’.
All Parameters/Shortcodes can be seen in FAQ:
* FAQ
Advanced Parameters:
numberofposts (Number of posts)
Limit/Specify the number of posts you want to display
Default: 3
Example: [recentposts-sc numberofposts=”6″]
post_type (Post Type)
Specify which post type you want to use. For example posts or pages
Default type: post
Example: [recentposts-sc post_type=”page”]
get_cat_name (Category Name)
If you want to display category name in list of posts
Default: False
Example: [recentposts-sc get_cat_name=”true”]
excerptlength (Custom Excerpt Length)
Define custom excerpt length
Example: [recentposts-sc excerptlength=”30″]
enable_excerpt (Show/hide Excerpt display)
Sometimes you may not want to display excerpt and only like to keep title and image. To turn off/disable excerpts use enable_excerpt=”false” (default is true)
Example: [recentposts-sc enable_excerpt=”false”]
image_size (Display default/custom image size instead of featured image)
Select image size like thumbnail, medium etc (by default featured image is displayed)
use image_size (default is false)
Example: [recentposts-sc image_size=”thumbnail”] or [recentposts-sc image_size=”medium”]
You can also use any custom image size if present in your website.
category (Posts from specific Category/categories)
Filter posts from single category or multiple categories
Example single category: [recentposts-sc category=”lesson”]
Example multiple categories: [recentposts-sc category=”lesson,lesson2,lesson3″]
author (Posts from specific author)
Filter posts from specific author
Example: [recentposts-sc author=”admin”]
More Parameters/Shortcodes can be seen in FAQ:
* FAQ.
Developed by rajros
For sidebar also use [recentposts-sc] in text widgets (refer screenshots as well for further help)
Advanced Parameters:
numberofposts (Number of posts)
Limit/Specify the number of posts you want to display
Default: 3
Example: [recentposts-sc numberofposts=”6″]
post_type (Post Type)
Specify which post type you want to use. For example posts or pages
Default type: post
Example: [recentposts-sc post_type=”page”]
get_cat_name (Category Name)
If you want to display category name in list of posts
Default: False
Example: [recentposts-sc get_cat_name=”true”]
excerptlength (Custom Excerpt Length)
Define custom excerpt length
Example: [recentposts-sc excerptlength=”30″]
enable_excerpt (Show/hide Excerpt display)
Sometimes you may not want to display excerpt and only like to keep title and image. To turn off/disable excerpts use enable_excerpt=”false” (default is true)
Example: [recentposts-sc enable_excerpt=”false”]
image_size (Display default/custom image size instead of featured image)
Select image size like thumbnail, medium etc (by default featured image is displayed)
use image_size (default is false)
Example: [recentposts-sc image_size=”thumbnail”] or [recentposts-sc image_size=”medium”]
You can also use any custom image size if present in your website.
category (Posts from specific Category/categories)
Filter posts from single category or multiple categories
Example single category: [recentposts-sc category=”lesson”]
Example multiple categories: [recentposts-sc category=”lesson,lesson2,lesson3″]
author (Posts from specific author)
Filter posts from specific author
Example: [recentposts-sc author=”admin”]
label (Custom label for “Read More”)
Apply your own custom read more label
Example: [recentposts-sc excerpt_more=”true” label=”Keep Reading…”]
after and before (Filter Posts between specific dates)
Example : [recentposts-sc after=”January 5th, 2015″]
This will display only posts which is published after Januray 5th, 2015
Example : [recentposts-sc before=”October 6th, 2015″]
This will display only posts which is published before Januray 5th, 2015
Example : [recentposts-sc after=”January 5th, 2015″ before=”October 6th, 2015″]
This will display only posts which is published between Januray 5th, 2015 and October 6th, 2015
include_author (Display author name and link)
Example: [recentposts-sc include_author=”true”]
orderby (Order posts by name, title, date etc)
Example: [recentposts-sc orderby=”name”]
Instead of recent posts you can display random posts
Example: [recentposts-sc orderby=”rand”]
order (Order posts in ascending or descending order)
Example: [recentposts-sc order=”DSC”]
post_ids (List only specific posts by their IDs)
Example: [recentposts-sc post_ids=”181,189,194″]
offset (Offset/skip posts)
Example: [recentposts-sc offset=”1″]
tag (Filter posts containing specific tags only)
Example: [recentposts-sc tag=”lesson1,lesson2,lesson”]
meta_key(Filter posts on meta_key)
Example: [recentposts-sc meta_key=”size”]
meta_value(Filter posts by meta values)
Example: [recentposts-sc meta_value=”small, medium”]
show_image(default is true. To hide images use false)
Example: [show_image=”false”]
Version 1.8
* Option to show/hide images using show_image. Tested upto wordpress version 4.9.4
Version 1.7
* Option to show/hide images using show_image. Tested upto wordpress version 4.9.1
Version 1.6
Version 1.5
Version 1.4
Version 1.3
Version 1.2
Version 1.1