sandywp / plugins / same-category-posts
Same Category Posts
Show posts related to the current category or other custom post types.
Ready in seconds.
v1.2.1 3,000+ installs WP 6.3+ PHP 7.2+

What you get inside
4 screens-
Option to exclude categories (and terms) and filter by popular posts (by comment count).
-
Front end of the widget using a default WordPress Theme.
-
Option 'Separate categories' (If more than one assigned) will separate and link to all assigned categories.
-
The widget configuration dialog.
About this plugin
Same Category Posts shows a list of related posts with a same Post Type to the current post. It comes as a classic widget and as a block, both with the same options and the same output. The list is only shown on single post pages and on archive pages. Forked from Related Posts Widget.
Tip Top Press
We’re Tip Top Press and create widgets for WordPress. If you want to know about what we’re working on and you are interested in backgrounds then you can read all newes storys on our blog.
Features
- Shows a list of related posts.
- Option which Post Type should be related to the current post.
- Custom Post Types support.
- Child category and terms support.
- Archive page support.
- Option exclude one or multi categories or terms.
- Option to filter by popular posts (by comment count).
- Option separate categories if more than one is assigned.
- Set how many posts to show (overall and by category).
- Option exclude current post, sticky posts or children.
- Option exclude categories and terms without exclude their children.
- Placeholders in title string (e.g. “There are a lot of %cat%-News.” -> “There are a lot of Tech-News.”).
- Filter hook for the post titles ‘widget_title’.
- Option to show post thumbnail and set width & height.
- Option to crop thumbnails dimensions with CSS.
- Option to put thumbnail on top.
- Option to make the widget title link to the category page.
- Option to show/hide the title.
- Option to show the post excerpt and how long (in words).
- Option change excerpt ‘more’ text.
- Option to show the post date, author and comment count.
- Block with the same options as the widget, with a live preview in the editor.
Placeholder
In text boxes %cat% will replaced with the (first assigned) category name, e.g. “There are a lot of %cat%-News.” -> “There are a lot of Tech-News.”
And %cat-all% will replaced with all assigned category name, e.g. “Special offers for %cat-all%!” -> “Special offers for houses, flats, apartments.”
Contribute
While using this plugin if you find any bug or any conflict, please submit an issue at
Github (If possible with a pull request).
Questions
- Post title filter example
To use the the hook add a filter ‘widget_title’ in wp-content\Themes[your-Theme]\functions.php:
function cruise_shortcode_iconship( $html ) {
return “prefix-” . $html . “-suffix”;
}
add_filter( ‘widget_title’, ‘cruise_shortcode_iconship’ );- The feature image dimention are not correctly displayed?
Enable the option “Use CSS cropping”. This option don’t care about stored setting (Settings > Media) or added image sizes. What is ‘CSS feature image cropping’?
- Excerpt length filter doesn’t works
When a post has no manual excerpt WordPress generates an excerpt automatically by selecting the first 55 words of the post or the first words number setted by the excerpt filter length. This means the excerpt length filter works only with automatic excerpt. If you manually added an excerpt, you’d want it all to be shown.
WordPress Codex: Excerpt, automatic excerpt, and teaser- I want the title as a link pointing to the selected Categorie page?
Enable the check box “Make widget title link”.
- Exclude (-terms) text area
To multiselect or clear terms in the “exclude”-text area hold CTRL-key + mouse click. In the block, type or pick the terms in the “Excluded terms” field and remove them with the x on each entry.
- Why does the block show nothing in the editor?
The list is built from the terms the post is saved with. A post that has no category yet, or one whose only category is excluded, has nothing to relate to, so the block stays empty — as it would on the front end.
sandywp / also on the shelf
Try another plugin
4.6 · 4K+ installs
Latest posts widget to display recent posts from category.
200+ installs
Display random posts from selected categories or current category or all posts with thumbnail images (optional).
Recent Posts From Each Category
3.7 · 40+ installs
Display Recent Posts From Each/Selected Category. Category Box View Plugin.
Spin up a real WordPress site in seconds.
Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.