Posts in Sidebar

Fork me on GitHub

Posts in Sidebar is a plugin for WordPress that lets you show a list of your posts using the criteria you want. This plugin gives you almost all the power of WordPress to retrieve the posts you want and show them in your sidebars.

The plugin has also a shortcode, that you can use in your posts/pages to list your posts.

Once installed, Posts in Sidebar creates a new widget for your sidebar. Add it to your sidebar, select the options to retrieve the posts you want, and save the widget: you're done!

Here are some of the functions you'll have:

  • get posts by authors, categories, tags, post format, or any custom taxonomy;
  • get posts by exact IDs;
  • get posts by meta key/value;
  • get posts by modification date;
  • get posts children of other posts;
  • get posts by search;
  • get posts by complex taxonomies queries;
  • get posts by date queries;
  • get posts from the category of the current post;
  • exclude posts by authors, taxonomies, and so on;
  • control which elements of the posts are displayed (like post thumbnail, taxonomies, meta values, and so on);
  • stylize the output of the widget using custom CSS styles;
  • cache the output of the widget to save queries to the database;
  • ... and much more.

The powerful WordPress class WP_Query is at your fingertips with this plugin. To understand what this plugin can do, take a look at this Codex page: almost all these functions are already included in Posts in Sidebar.

This plugin is free software and it's developed with many efforts: a donation is very appreciated.


Documentation, Help & Bugs

The plugin's documentation is hosted on GitHub. Please refer to it before asking for support.

If you need help, please use WordPress forum. Do not send private email unless it is really necessary.

If you have found a bug, please report it on GitHub.

This plugin is developed using GitHub. If you wrote an enhancement and would share it with the world, please send me a Pull request.


I would like to say Thank You to all the people who helped me in making this plugin better.

Translations of the plugin

This plugin has been translated into these languages:

  • Persian, thanks to AlirezaJamali
  • French, thanks to Thérèse Lachance and cilya
  • Hebrew, thanks to Ahrale
  • Serbo-Croatian, thanks to Borisa Djuraskovic


About this plugin

Name of the plugin: Posts in Sidebar
Plugin version: 3.7
This plugin requires WordPress 4.1
Tested up to WordPress 4.5.2
Last updated: 24 maggio 2016 (4 ore ago)
Compatibility: Unknown with WordPress 4.5.2
Tags: Post, sidebar, widget
Downloaded: 110.019
Rating: 5 stars

Latest changes

  • NEW: Added support to get posts, when on single post, from user-defined category/tag using custom field (props by Mike S).
  • NEW: Added support for changing number of posts when on single post.
  • FIX: fixed displaying comments string when using languages different from English.


You can get a copy from the page in the official repository: Posts in Sidebar. This plugin has been downloaded 110.019 times.


Author’s name: Aldo Latino
Profile on Aldo Latino


  1. posts-in-sidebar screenshot 1

    The widget panel (all sections are closed).

  2. posts-in-sidebar screenshot 2

    The widget panel (all sections are open).

  3. posts-in-sidebar screenshot 3

    A simple output of the widget: title, excerpt and link to the entire archive.

  4. posts-in-sidebar screenshot 4

    Displaying the featured image, floating left.

  5. posts-in-sidebar screenshot 5

    The same image as before, but in larger size.

  6. posts-in-sidebar screenshot 6

    The introductory text for the widget.

  7. posts-in-sidebar screenshot 7

    Displaying the full set of items (categories, date, author, tags, and so on).



  • NEW: Added support to get posts, when on single post, from user-defined category/tag using custom field (props by Mike S).
  • NEW: Added support for changing number of posts when on single post.
  • FIX: fixed displaying comments string when using languages different from English.


  • NEW: now the user can remove the link of the featured image.


  • NEW: Added support to get posts by the author of the current post (props by Derek).
  • FIX: fixed getting posts by category slug.
  • Updated the shortcodes options.


  • Updated the shortcodes options.


  • FIX: fixed wrong characters displaying in custom field values (props by bubdev).
  • Minor improvements.


  • NEW: Added option to truncate the custom field content (props by bubdev).


  • NEW: Added support to get posts from the category of the current post (props by wendygordon).
  • Minor improvements.


  • NEW: Added option to display the modification date (props by ecdltf).


  • Fixed shortcodes execution in "Full content" type of text (thanks to fabianfabian for reporting).
  • Added check if the post is private.
  • Added check for current post in pages.
  • Added link to review page in the plugins list page.


  • NEW: Added the shortcode.
  • NEW: Added Gravatar support for authors.
  • NEW: Added "Any" to posts status.
  • NEW: Added an option to change the tooltip in the title link.
  • Reorganized the widget sections.
  • Changed some files names.
  • Changed translation domain into posts-in-sidebar.


  • Fixed custom container DIV (thanks to felipebadr).
  • Minor improvements.


  • FIX: Fixed sticky posts.
  • The complete list of widget options is now fully displayed.
  • Other minor improvements.


  • FIX: Fixed link on widget title.


  • FIX: Fixed printing local style.


  • NEW: Support for taxonomy complex queries (requires WordPress 4.1).
  • NEW: Support for date queries.
  • NEW: Support for for getting and excluding posts by multiple authors.
  • NEW: Support for queries based on search.
  • NEW: Support for getting and excluding posts that are children of other posts.
  • NEW: Support for custom taxonomies.
  • NEW: Added support for custom link in featured image (props by troy-f).
  • NEW: Changed appearance for widget sections that are collapsible now.
  • WordPress 4.1 is required (for nested taxonomy handling).
  • Added URL of the site and WordPress version in the debug section.
  • Switched to PHP5 __contruct() in creating the widget.
  • Improved security.
  • Fixed PHP notices when upgrading from previous versions.
  • Updated the Hebrew translation (thanks to Ahrale).


  • Added check for "NULL" (as string) value in certain variables.
  • FIX: Now the plugin correctly displays attachment post type.
  • FIX: Custom featured images are now displayed when the user choose no text to display.


  • NEW: Now it's possible to display the name of the taxonomy in the archive link.
  • FIX: resolved multiple PHP notices.


  • Compatibility with Relevantssi plugin (props by KTS915).
  • Updated the Hebrew translation (thanks to Ahrale).


  • NEW: Added options to use a custom image instead of the standard featured image (props by joaogsr).
  • NEW: Added class "sticky" if a post is sticky (props by acrok).
  • CHANGE: Added a checkbox to completely hide the widget if no posts are found (instead of removing the "no posts text" in order to do this).
  • Added placeholders in HTML fields.


  • FIX: resolved "No posts" issue when upgrading from 1.22 version.
  • Updated Hebrew (thanks to Ahrale) and Italian translations.


  • NEW: the widget can be hidden now if no posts are found (props by der_velli).
  • NEW: Added the option to display the full size of the featured image (props by Ilaria).
  • Moved plugin's functions files into subfolder.
  • Moved plugin's functions into separate file.
  • Added debugging tools.
  • Fixed one undefined index notice.
  • Updated the Hebrew translation (thanks to Ahrale).
  • Code improvements.


  • NEW: Added an option to display only the "Read more..." link.
  • Updated the Hebrew translation (thanks to Ahrale).
  • Added Serbo-Croatian language (thanks to Borisa Djuraskovic).


  • NEW: Added an option to exclude the current post in single post page or the current page in single page.
  • Added an alert in the widget admin if the current theme doesn't support the Post Thumbnail feature.


  • FIX: Now the dropdown menu for post type selection correctly displays all the public post types (thanks to pathuri).


  • NEW: Selection of categories and tags is in form of comma separated values. This will prevent server load in case there are too many terms. Also, now the user can get posts from multiple categories.


  • NEW: The section with author, date, and comments can now be displayed before the post's excerpt.
  • Various small improvements.


  • NEW: Added option to exclude posts with certain IDs.
  • NEW: Added option to display image before post title.
  • NEW: Completed options for Order by parameter.
  • Now the plugin requires at least WordPress 3.5.
  • Code optimization.
  • The class for the custom container class is now sanitized.
  • The custom container receives now only a single CSS class.
  • Completed the PhpDocumentor tags.


  • NEW: The cache can be flushed now.
  • Updated Hebrew translation.


  • NEW: Added a field to define a class for a container.
  • NEW: Now the user can define a cache when retrieving posts from database.


  • FIX: The HTML for ul is now fixed.


  • NEW: The posts can be retrieved using the ID (props by Matt).
  • NEW: The list of posts can now be displayed in a numbered list (props by Sean).
  • NEW: The excerpt can be displayed up to the "more" tag (props by EvertVd).
  • FIX: There are no more empty spaces after "Category" or "Tags" text.
  • The widget panel has been slightly enlarged.
  • Deleted unused options in widgets dropdown menus.
  • Minor refinements.


  • FIX: fetching posts from tags now works correctly.
  • Updated Hebrew translation, thanks to Ahrale.


  • NEW: Added option for adding user defined styles (props by Ahrale).
  • NEW: Added option for setting the space around the image (props by Ahrale).
  • NEW: Added check for rtl languages (the arrow can now be from right to left, props by Ahrale).
  • NEW: Added option for ordering by "Menu order" and "Comment count" (props by hypn0ticnet).
  • Updated Hebrew translation (thanks to Ahrale).
  • Minor bug fixings.
  • Minor enhancements.


  • NEW: added option for rich content.
  • NEW: added option for displaying the custom fields value/key of the post.
  • NEW: added option for removing bullets and extra left space for the list elements.
  • Code improvements.


  • FIX: image align has been fixed (thanks to Clarry).


  • FIX: If the post is password protected, now the post password form is displayed before showing the post.
  • NEW: Now the user-defined excerpt can display a paragraph break, if any.
  • NEW: Added Hebrew translation, thanks to Ahrale.
  • Other minor changes.


  • NEW: The space after each line can be defined via widget interface.
  • NEW: The featured image can be aligned with text.
  • NEW: Added apply_filters where needed.
  • FIX: HTML structure for the archive link is now W3C valid, thanks to cilya for reporting it.
  • Updated French translation, thanks to cilya.
  • Minor bug fixings.


  • New: added post format as option to get posts.
  • New: added option for link to custom post type archive.
  • New: added option for link to post format archive.
  • Other minor changes.


  • New: The widget can display the author of the post.
  • New: Now the user can choose which type of posts to display: posts, pages, custom post types, etc.
  • New: The widget can display the full content (as in single posts).
  • New: Now the user can add a custom "Read more" text.
  • Added French translation by Thérèse Lachance.
  • Code improvements and sanitization.


  • New: if in single post, the user can now stylize the current post in the sidebar (feature request from lleroy).


  • New: Now the title of the widget can be linked to a user-defined URL (feature request from Mike).


  • New: Now the user can add an introductory text to the widget (feature request from Mike).


  • New: The date can be linkified or not.
  • New: The widget panel now shows empty categories and tags.
  • New: The 'No posts yet.' text can be customized.
  • Bug fix: The markup no longer shows empty containers.
  • Some minor enhancements.


  • Changed the minimum required WordPress version to 3.3.
  • Added Persian language, thanks to AlirezaJamali.


  • Enhancement: Now the user can display the entire content for each post. Feature request from sjmsing
  • Moved screenshots to /assets/ directory.


  • Enhancement: Now it is possible to show the categories of the post
  • Enhancement: Now it is possible to exclude posts coming from some categories and/or tags
  • Moved the widget section into a separate file.


  • Updated Riconoscimenti section.


  • Small typo in readme.txt.


  • First release of the plugin.



Other Notes


You can get support in this forum.


Say your “Thanks!” to the developer with a small donation.

19 pensieri riguardo “Posts in Sidebar”

  1. Hi I think your widget is perfect for my needs however i cant seem to get it to work! I’m using the new twenty twelve theme with enabled thumbnails. I’ve installed your posts in sidebar widget and for some reason cant see it in front end – this is very strange… I’m trying it on my localhost – could this be a problem?

    1. What don’t you see in your sidebar? The widget? Or the featured image (i.e. the post’s thumbnail)? Or the entire widget?

      I’ve just installed this plugin in a totally clean WordPress environment using the Twenty Twelve theme and I can’t reproduce it.

        1. After installing this plugin, you have to go to Appearance > Widgets. Do you see the widget in the list of available widgets? Have you added the widget to your sidebar?

        2. Of course. I do see the widget in my admin and have added/dragged it to my widget-ready sidebar. I open it up and choose a category so it will know which posts to show, then click Save, and refresh my front end. Nothing… (no doubt this is not the first widget I’ve installed, which makes it even more frustrating : (
          I’ve also considered maybe the file I’ve downloaded might be corrupt in some way, however if that was the case I wouldn’t see it and be able to activate it…

        3. Try to deactivate all the plugins and leave active only Posts in Sidebar. Does it work?

          Another better way is to try the plugin in a totally fresh WordPress installation. Because you’re in a localhost environment, this is simple to do. Try and let me know.

          Also, make sure you’re using the last version of WordPress.

        4. OK, so I went and installed a new localhost wp and the widget works! I have no idea why it wouldn’t on my own site. Now all I have to do is figure this *small* thing out. And if we’re on the subject I have another question (if I may) – I’ve created a new add_image_size however I don’t see it in the widget featured image thumbnail size… Any thoughts?
          I really appreciate your help

        5. OK scratch that! found the new image size – all is OK.
          However this is the strangest thing – you will not believe it! I went back to my original localhost site – disabled all plugins – activated yours and clicked Save. Nothing in the front end. Went back to the Widget area and saw that your widget has been removed from my sidebar (in the admin itself!) – how strange is that?!

        6. I’m happy reading you solved! :-)

          About the “strangest thing”, if you disable and re-enable the plugin, the widget should be restored in the position you put it. Strange, sure. The plugin erases its own data (number of widgets and their positions included) only if you uninstall it (as every developer should do, but the majority don’t).

        7. I think it’s more than that – after I enabled the plugin – dragged the widget into sidebar – refreshed the page (still in admin) – widget has been automatically removed from sidebar! What the…

        8. One last question – is there any way to embed this plugin inside the template as opposed to using as a widget?

  2. Hi Aldo, just wanted to tell you YET AGAIN how really good your Post in Sidebar really is. I really like the like random setting which jumbles up the posts and allows older posts to be displayed on the sidebar. Suggestion: Underneath the title of the Widget is it possible to allow a short introduction ? It would be good to show the reader what the category is and why it is different from the others. Many thanks, Mike Churcher

  3. Ciao, cercavo un modo per integrare questo plugin con quello Youtube, l’obiettivo è quello di mostrare il post più recente della categoria “musica” nella sidebar. Non riesco a far funzionare i due plugin insieme, consigli su come procedere?

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *