A simple tweak for the WordPress YARPP plugin

Post image for A simple tweak for the WordPress YARPP plugin

by bledsoe on August 16, 2009

Someone recently asked me to make a small change to the Yet Another Related Posts Plugin (YARPP) which she had recently added to her WordPress site.  (For each of your published posts, YARPP will display a list of related posts, the idea being that if readers enjoyed the post they just read, they might want to read a related post as well.)

YARPPspaceThe desired change was simply to remove the blank line between the "Related posts" heading and the first related post.  It turns out that this can be done by inserting some code in the YARPP settings page, but unless you're somewhat familiar with CSS, it's not immediately obvious what code to insert.  Here's what you do:

After you install YARPP, click on the "Related Posts (YARPP)" link under the Settings heading in the left sidebar.  On the YARPP settings page, scroll down to the "Display options for your website" section about halfway down and find the heading that says "Before/after related entries."

BeforeAfter

The first box next to this heading contains an opening paragraph tag (<p>) and you want to add some CSS code to make that tag look like this:

<p style="margin-bottom:0;">

Click the "Update options" button at the bottom of the screen and your list of related posts will now look like this:

YARPPnospace

[If you're interested in more details on how this little bit of CSS works its magic, take a look here and here.]

Previous post:

Next post: