Posts in Sidebar 4.1 released

After only two weeks from the last release, a new version of Posts in Sidebar has been published. The new version adds an option to get posts by recent comments and an option to display all the custom fields of a post.

Get posts by recent comments

The new option “Get posts by recent comments”.

Now you can display the posts where readers have left their recent comments. So, if a reader has just left a comment in a certain post, that post will be displayed on top of others. This is a forum-like behavior, that has been requested by some users of the plugin. As of today, WordPress hasn’t this capability, so I have added a specific function to make a custom query to the database. When you activate this option, other parameters will be ignored, namely these:

  • order: the order will be descending, because we want to display the most recent commented posts first;
  • order by: the “order by” option will be post__in, because WordPress must display the posts in an exact order of IDs;
  • post status: obviously we want only published posts.

Display all the custom fields

The new option “Display all the custom fields”.

In Posts in Sidebar there is an old option to display a specific custom field. In this new release I’ve added the possibility to display all the custom fields of a post. I certain sites it’s perfect to display all these extra informations. From 4.1 this plugin can do that.

All custom fields lines have two CSS classes: one standard pis-custom-field and one with a leading pis- plus the name of the custom field key, according to this schema:

<p class="pis-custom-field pis-{name of the custom field}">

So, for example, if we have a custom field “Price” with a value of “$15.00”, this will be the resulting HTML code:

<p class="pis-custom-field pis-price">
	<span class="pis-custom-field-key">Price</span>
	<span class="pis-custom-field-divider">:</span>
	<span class="pis-custom-field-value">$15.00</span>
</p>

In this situation you can make a precise styling of every line, or even hide certain lines or single elements.

Hope you find Posts in Sidebar more and more useful at every new release. Enjoy!

Author: aldolat

A WordPress fanatic.

Leave a Reply

Your email address will not be published. Required fields are marked *