Related Posts plugin for WordPress
By Barry Kooji and Never5.
A related posts plugin will show similar posts from the same site usually at the bottom of an article.
There are a few plugins out there but feel that they are too bloated so decided to test out the Related Posts plugin from Barry Kooij.
Here is the default related posts CSS design as seen under a post.
Title top left, image left, post title right and an excerpt. This can be changed through CSS.
Barrys plugin seems lightweight and does not add any extra bloat to the site.
I downloaded and installed the Related Posts plugin. After activating the plugin it goes to a specific installation screen.
- Caching Posts.
- Linking Posts.
- Finished.
I went to Settings -> Related Posts.
There is the settings screen for the plugin.
Adjustments that I made were change the amount of posts, excerpt length and display image.
Remember to click Save Changes.
Below each post is a section / Meta Box named Related Posts. Here one can manually go in and adjust which post to have in the Related Posts list. Hovering over a title shows the quick edit bar with the option to Edit the Post or Unlink Related Post. One can also add other posts.
Plugin Settings screen
The following is the default CSS layout code that is inside the CSS box in the plugin settings area.
.rp4wp-related-posts ul {width:100%;padding:0;margin:0;float:left;}
.rp4wp-related-posts ul>li {list-style:none;padding:0;margin:0;padding-bottom:20px;clear:both;}
.rp4wp-related-posts ul>li>p {margin:0;padding:0;}
.rp4wp-related-post-image {width:35%;padding-right:25px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;}
I deleted the default CSS code so it would not disrupt the custom code I am creating below. (I am though using some of the default code in the custom CSS.)
Through the plugin settings I changed amount of posts to 4. (The setting can be overwritten by removing or adding related content below a post.)
Set excerpt length to 0.
The new custom CSS I used (The code can be added to your stylesheet or the CSS box inside the plugin settings replacing what is already in it).
/* Related Posts plugin custom CSS */
/* Area surrounding the related posts */
.rp4wp-related-posts {
width:100%;
}
/* Related Posts title */
.rp4wp-related-posts h3{
font-size: 34px;
color: #474545;
font-family: times;
text-align: center;
text-shadow: 1px 1px 1px #ccc;
}
/* each related post group - image and text */
.rp4wp-related-posts ul>li {
padding: 15px;
margin: 0 0 20px 0;
float: left;
width: 25%;
}
Another custom CSS example used with the Related Posts plugin.
CSS used (add the CSS to your stylesheet or the CSS box inside the plugin settings screen).
/* Related Posts plugin custom CSS */
/* Area surrounding the related posts */
.rp4wp-related-posts {
width:85%;
padding:10px;
margin:0;
float:left;
background: #f89a16;
border: 1px solid #ccc;
border-radius: 7px;
}
/* Related Posts title */
.rp4wp-related-posts h3{
font-size: 34px;
color: #fff;
font-family: times;
text-align: center;
text-shadow: 2px 1px 1px #000;
}
/* Post content -text */
.rp4wp-related-post-content {
padding:3px;
}
/* image */
.rp4wp-related-post-image {
width: 28%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
float: left;
}
/* each related post group - image and text */
.rp4wp-related-posts ul>li {
list-style: none;
padding: 15px;
margin: 0 0 15px 0;
clear: both;
background: #fff;
border: 1px solid #ccc;
border-radius: 7px;
min-height: 180px;
box-shadow: 0px 3px 5px #444;
}
A custom design where I moved the title above the images.
Custom CSS (Add to your stylesheet or the CSS box inside the plugin settings.)
/* Related Posts plugin custom CSS */
/* Area surrounding the related posts */
.rp4wp-related-posts {
width:100%;
padding:10px;
margin:0;
float:left;
background: #f89a16;
border: 1px solid #ccc;
border-radius: 7px;
}
/* Related Posts title */
.rp4wp-related-posts h3{
font-size: 34px;
color: #fff;
font-family: times;
text-align: center;
text-shadow: 2px 1px 1px #000;
}
/* Post content -text */
.rp4wp-related-post-content {
padding:3px;
margin-top: -250px; /* Moving text/title above the image */
}
/* image */
.rp4wp-related-post-image {
/* width: 28%; */
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding-top: 80px; /* Giving space for the text/title above the image */
}
/* each related post group - image and text */
.rp4wp-related-posts ul>li {
list-style: none;
padding: 15px;
margin: 0 0 15px 0;
background: #fff;
border: 1px solid #ccc;
border-radius: 7px;
min-height: 280px;
box-shadow: 0px 3px 5px #444;
width: 25%;
float: left;
}
Check out the article on the pro version of the same plugin.
Hello, thank you so much for the examples. Would you please be so kind and tell me how to switch /* Related Posts title */ to h2?