The Most Flexible Featured Posts Widget You’ll Need

In: WordPress Plugin Reviews| WordPress Tutorials - Intermediate

Buffer this pageTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone

Flexible Posts Widget WordPress Plugin

Recently I had a client that needed to display a grid of images in a sidebar widget, each one of which would link to a different page. Previously they had hard coded all the images and links as HTML in a text widget but this was understandably a pain for the client to maintain and update.

I previously used Special Recent Posts as my go-to plugin for this type of thing (although I’m not sure it could handle Pages) but the free version is no longer being updated so I needed a new solution. Fortunately I found the Flexible Posts Widget plugin – the best featured posts widget I think you’ll ever need.

The reason this plugin is awesome is because it truly offers the most flexible options. The default Recent Posts widget in WordPress outputs a list of the titles of your recent blog posts and the only option you have is how many to show.  This plugin takes this basic concept and turbocharges it.  You can feature regular posts, pages, custom post types or any combination!

Flexible Posts Widget - Post Types

You can also use any taxonomy – whether the regular categories and tags you have for your posts, or any custom taxonomy you have created. Based on that you can have the widget dynamically populate – meaning it could always show whatever your most recent content is for example, without you needing to manually update the widget.

Flexible Posts Widget - Taxonomy

In my use case, the client had specific content he wanted to feature there so he needed to be able to handpick the pages. The plugin offers that feature as well – you can provide it the IDs of whatever posts/ pages to feature.

Page and Post IDs are not intuitive to find by default – you have to look in the URL when on an edit screen to locate the ID. So I use the Reveal IDs plugin to make those easily accessible to the client.

Reveal IDs WordPress Plugin

By default the widget will display a list of the post or page titles as a list. The plugin does not add its own styling, so the output is handled by your theme and therefore will match your other widgets. You can choose whether or not to include the featured image as well as the title.

Customizing The Featured Image Size

In my case the client wanted a 2 column layout of small images. The plugin allows you to select which image size to use. By default WordPress creates three image sizes each time you upload a photo – thumbnail, medium and large. The dimensions of those are defined in Settings > Media. Additional custom image sizes for specific purposes can be added – many themes and plugins do this,

In my case the images needed to be smaller than the thumbnail size defined in the client’s site, so I had to create a custom image size that the plugin could use. I needed a new image size of 80 x 80 pixels. To register a new image size I followed the Codex guide.

It’s as simple as adding this code to the child theme’s functions.php :

As you can see in line 4 of the snippet above, I called my new image size “widget-thumb”. Now when I go into the Flexible Posts widget my new image size is available as an option.

Flexible Posts Widget - Thumbnail Image Size

The different image sizes are generated as you upload images to your media library. So for all the pages/posts that had already been created and assigned featured images, the new 80 x 80 size did not yet exist. So I used
the Regenerate Thumbnails plugin to go back through the media library and create the new image size. This means that all the client needs to do is assign a featured image for each page if there isn’t one already, and the widget will pull it in at the correct size.

Customizing The Display Template

Another customization I had to do was to remove the page title from the output of the widget. The client only wanted the images to display, not the page titles. While there isn’t a specific option built in to the plugin interface to remove that, it does have a cool way of handling customization needs. The plugin uses a file called widget.php to control the output.  If you want to customize it, all you have to do is copy that file to your theme folder and make your changes there. Your changes remain protected from plugin updates. So it was easy enough for me to do that and remove the line of code that output the post titles. The plugin doesn’t give you the option of including an excerpt by default, but with one other line of code you could easily add that in to the template file.

Overall I like this plugin because it has really flexible options that a beginner can take advantage of, but for developers it offers a great way to customize and take it further.

*header image credit

Buffer this pageTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
Weekly WordPress Tips To Your Inbox
+ Get 50% Off The Beginner's Guide to SEO Ebook!

Lucy Beer - WebTrainingWheels WordPress TrainingDo you need a personal WordPress teacher to help you learn what you need to know without wasting time? I provide customized WordPress tutoring in-person or remotely via phone/screensharing.


10 Responses to The Most Flexible Featured Posts Widget You’ll Need

Avatar

John

January 12th, 2014 at 4:57 pm

Awesome. I just used on my blog site. Thanks for the detailed post

Avatar

@jenn_pilgrim

March 22nd, 2014 at 1:04 pm

Excellent article on a plugin to display posts that I choose in my #blog sidebar! This is just what I was looking for! Thank you @webtw! http://tinyurl.com/q9lc5wj

Avatar

tblue

April 12th, 2014 at 7:27 am

Hi there! Geat info and great resource. How did you then get the thumbnails to display in a 2-column layout? My client wants a 2×2 grid of current post thumbnails. Thanks!!!!

Avatar

LucyBeer

April 14th, 2014 at 1:57 pm

Hey there
I had to do a little custom CSS to create the grid by floating the list elements left, as I remember. It's not too hard if you know any CSS.
Cheers
Lucy

Avatar

tara locklear

April 14th, 2014 at 4:57 pm

Ok sounds great. thought there might be more to it. thnx!

Avatar

india

May 21st, 2014 at 9:22 pm

How did you remove the post title from being displayed? I need to display images only. Thanks

Avatar

LucyBeer

May 22nd, 2014 at 5:17 pm

I customized the template a little to remove the titles. This link explains how to make modifications: http://wordpress.org/plugins/flexible-posts-widge

Avatar

Correen

August 16th, 2014 at 1:08 pm

Just wanted to thank you for posting about this plugin…it rocks and makes my post and pages look extra special!

Avatar

Brad

September 8th, 2014 at 5:36 am

Hey. Can you share the CSS you used ? It would give us hints to customize our own CSS. Thanks in advance. Brad

Avatar

LucyBeer

September 8th, 2014 at 11:45 am

This is the CSS that worked for me: http://pastebin.com/1fHxsmZC

Comment Form

Weekly WordPress Tips

+ Get 50% Off The Beginner's Guide To SEO Ebook!

How I Can Help You

Hi! I'm Lucy Beer. I know that WordPress is liberating when you know how to use it, and bewildering when you don’t. I help individuals and businesses learn WordPress for their specific needs. I will accelerate your knowledge and cut your learning curve in half (at least!). Generic tutorials and videos only go so far - when you need specialized knowledge, or a real person to answer your questions, that's where I come in. I help non-techies understand and use the web to empower their personal or business mission.

Learn How To Get Targeted Traffic To Your Site >> $20

Socialize

Services I Use & Recommend

Siteground Hosting
Sucuri
WP Engine
Gravity Forms
  • Elen: Hi! Totally new WordPress user here. Came across your article and found it to be super helpful. Hopi [...]
  • kathy: Hi Lucy, Thank you so much for this post. It's exactly what I, as a total WP beginner, was loo [...]
  • Patrick @ SSDpress: It's often spambots which sign up and clutter your database with extra user accounts. As you sa [...]
  • Patrick @ SSDpress: "You get what you pay for" is very true. It's well known that lots of companies ' [...]
  • thegirlnextdoorisblack: Super helpful, thanks! [...]