Title: Flexible Posts Widget
Author: DaveE
Published: <strong>April 20, 2012</strong>
Last modified: Desember 31, 2016

---

Soek deur uitbreidings

![](https://ps.w.org/flexible-posts-widget/assets/banner-772x250.jpg?rev=590618)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/flexible-posts-widget/assets/icon-256x256.jpg?rev=984592)

# Flexible Posts Widget

 Deur [DaveE](https://profiles.wordpress.org/dpe415/)

[Laai Af](https://downloads.wordpress.org/plugin/flexible-posts-widget.3.5.0.zip)

 * [Besonderhede](https://af.wordpress.org/plugins/flexible-posts-widget/#description)
 * [Aanbevelings](https://af.wordpress.org/plugins/flexible-posts-widget/#reviews)
 *  [Installation](https://af.wordpress.org/plugins/flexible-posts-widget/#installation)
 * [Ontwikkeling](https://af.wordpress.org/plugins/flexible-posts-widget/#developers)

 [Hulp](https://wordpress.org/support/plugin/flexible-posts-widget/)

## Beskrywing

The default Recent Posts widget is exceptionally basic. I always find myself in 
need of a way to easily display a selection of posts from any combination post type
or taxonomy. Hence, Flexible Posts Widget.

Flexible Posts Widget (FPW) is more than just a simple alternative to the default
Recent Posts widget. With many per-instance options it is highly customizable and
allows advanced users to display the resulting posts virtually any way imaginable.

#### Features & options

 * Customizable widget title
 * Get posts by post type(s) and/or taxonomy & term(s) or directly by a list of 
   post IDs.
 * Control the number of posts displayed and the number of posts to offset.
 * Option to display the post feature image.
 * Select the post feature image size to display from existing image sizes: thumbnail,
   medium, large, post-thumbnail or any size defined by the current theme.
 * Order posts by: date, modified date, ID, title, menu order, random, Post ID Order;
   and sort posts: ascending or descending.
 * Each widget’s output can be customized by user-defined templates added to the
   current theme folder.
 * Multi Language support. Compatible with [WPML](http://wpml.org/) and [PolyLang](https://wordpress.org/plugins/polylang/)
   for sure. Not tested with other multi-language plugins, but it should work.

#### Plugin Hooks

Flexible posts widget currently has two public hooks:

 * Filter: [`dpe_fpw_args`](https://plugins.trac.wordpress.org/browser/flexible-posts-widget/trunk/includes/class-fpw-widget.php#L191)
   allows filtering the query vars before submitting the widget posts query.
 * Filter: [`dpe_fpw_template_{$template_name}`](https://plugins.trac.wordpress.org/browser/flexible-posts-widget/trunk/includes/class-fpw-widget.php#L354)
   filters the template file path used to display the widget output.

#### Future updates & feature requests list

 * Use search box instead of ID text field for post id’s
 * Shortcode functionality.
 * Get posts by Author.
 * Filter out the post currently being viewed.
 * Get posts from the same archive (term/post type/etc).
 * Limit results by a time period.

## Screenshots

 * [[
 * Configuring a FPW in wp-admin with the Post Type tab displayed.
 * [[
 * Configuring a FPW in wp-admin with the Taxonomy & Term tab displayed.
 * [[
 * Configuring a FPW in wp-admin with the ID tab displayed.
 * [[
 * An example FPW displayed using WordPress’s TwentyTwelve theme and the default
   Feature Image (post-thumbnail) size. This demonstrates how the plugin looks out-
   of-the-box with no user-customized styling or output in a default theme.
 * [[
 * In the Wild: FPW displaying a selection of featured beers (Post Type: Brew) over
   at http://canalparkbrewery.com. This example uses slightly customized output 
   and some theme-specific styles.
 * [[
 * In the wild: FPW displaying a selection media attachments, with custom thumbnails.
   This example uses highly customized HTML output and very theme-specific styles.
 * [[
 * In the wild: FPW displaying several posts over at http://chnl7700.mnsu.edu. Also
   highly customized output and theme styles.

## Installation

 1. Upload the `flexible-posts-widget` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Go to ‘Appearance’ > ‘Widgets’ and place the widget into a sidebar to configure
    it.

#### To use a custom HTML output template

 1. Create a folder called `flexible-posts-widget` in the root folder of the currently
    active theme.
 2. Copy `widget.php` from within the plugin’s `views` folder into your theme’s new`
    flexible-posts-widget` folder.
 3. Rename your theme’s `widget.php` template file to a name of your choice. Example:`
    my-template.php`.
 4. Go to ‘Appearance’ > ‘Widgets’ in WordPress to configure an instance of the widget.
 5. In the ‘Template Filename’ field choose the name of the template file you added
    to your theme. Example: `My Template`

## Kwel-vrae

  Installation Instructions

 1. Upload the `flexible-posts-widget` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Go to ‘Appearance’ > ‘Widgets’ and place the widget into a sidebar to configure
    it.

#### To use a custom HTML output template

 1. Create a folder called `flexible-posts-widget` in the root folder of the currently
    active theme.
 2. Copy `widget.php` from within the plugin’s `views` folder into your theme’s new`
    flexible-posts-widget` folder.
 3. Rename your theme’s `widget.php` template file to a name of your choice. Example:`
    my-template.php`.
 4. Go to ‘Appearance’ > ‘Widgets’ in WordPress to configure an instance of the widget.
 5. In the ‘Template Filename’ field choose the name of the template file you added
    to your theme. Example: `My Template`

  How does the “Comma-separated list of post IDs” work?

The third option (tab) available for getting posts is directly with a list of post
IDs. If there is a value in this field, any settings in the “Post Type” or “Taxonomy&
Term” tabs will be ignored and all public post types will be queried for the specific
post IDs provided. All the other widget options (Display, Thumbnails and Template
settings) will still be applied.

  How do I find a post’s ID?

Per a [WordPress support thread](https://wordpress.org/support/topic/where-can-find-the-post-id):

Go to Posts in your WordPress admin, and click the post you need the ID of. Then,
if you look in the address bar of your browser, you’ll see something like this:

    ```
    http://example.com/wp-admin/post.php?post=1280&action=edit
    ```

The number, in this case 1280, is the post ID.

  How can I display custom fields (custom meta values) with FPW?

You’ll want to create a custom HTML template by following [the instructions](https://wordpress.org/extend/plugins/flexible-posts-widget/installation/)
and then you can use the standard WordPress [Custom Field](https://codex.wordpress.org/Custom_Fields)
functions the same way you would if you were editing your theme’s other template
files.

A simple code example for a custom field named “test_field” _might_ look like the
following:

    ```
     $test_field_value = get_post_meta( get_the_ID(), 'test_field', true );
    echo $test_field_value;
    ```

  How can I style the images, titles or other widget output a certain way?

FPW intentionally does NOT add any styling of it’s own. To adjust the font size,
color, alignment, image size, etc. of any output from this widget, you’ll need to
edit your theme’s styles.

  Does this plugin/widget insert any styles or scripts into my site?

FPW does not add styles or scripts to your public theme. The plugin is intentionally
designed to work within your existing theme. FPW does add one stylesheet and one
JavaScript to the Widgets page in wp-admin to help with the administration of any
FPWs in use.

  Want to add support for another language?

I’d love to support more languages. The plugin’s POT file is available with the 
download. Feel free to post PO & MO files for your language to a [new forum thread](https://wordpress.org/tags/flexible-posts-widget/)
and I’ll get them added to the plugin.

  Questions, Support & Bug Reports

To get answers to your questions, request help or submit a bug report, please start
a [new forum thread](https://wordpress.org/tags/flexible-posts-widget/).

## Aanbevelings

![](https://secure.gravatar.com/avatar/8283db49d1fcf0b3cfe9b48569c631e14725b33ffdc9c370a9ff149cab860a68?
s=60&d=retro&r=g)

### 󠀁[Works ok](https://wordpress.org/support/topic/broken-608/)󠁿

 [aljuk](https://profiles.wordpress.org/aljuk/) Maart 5, 2019

![](https://secure.gravatar.com/avatar/2ddb1e941252ba3b8df5b34cbc8734726456f70726acaafb5a76b24c50b1aff1?
s=60&d=retro&r=g)

### 󠀁[URI problem](https://wordpress.org/support/topic/uri-problem/)󠁿

 [7am](https://profiles.wordpress.org/7am/) Julie 26, 2018

The URI are different when you’re admin or just subscriber. Don’t work for everyone.

![](https://secure.gravatar.com/avatar/f418d46643aeda715c1eb8f7805fcd0e87ea63bdd7f6cc675e5b23c0d5a4fa0d?
s=60&d=retro&r=g)

### 󠀁[Doesn’t work](https://wordpress.org/support/topic/doesnt-work-1885/)󠁿

 [Bobthearch](https://profiles.wordpress.org/bobthearch/) Mei 26, 2018

I can Select a Taxonomy as shown in the plugin screenshot, “Tags” for instance, 
but there is no Select Terms box. Without a way to select which tags, this plugin
is useless. I suspect it needs to be updated. How so many non-functioning never-
updated plugins are allowed to remain listed for all time at Wordpress… So frustrating.

![](https://secure.gravatar.com/avatar/975e90fc3ceaa220830add343098d02ff47735473e8be409a4968dc06bb95ef4?
s=60&d=retro&r=g)

### 󠀁[Total mess up of search engine results, no support](https://wordpress.org/support/topic/total-mess-up-of-search-engine-results-no-support/)󠁿

 [rom1our](https://profiles.wordpress.org/rom1our/) April 8, 2017

Imagine, you have a post about wedding and in the footer the flexible post widget
shows – when the crawler passes – in the category “practical tipps” the post “public
toilets”. When you search “public toilets in the city x” as result the search engine
will give out the post of the wedding. Probably it would be necessary to noindex
the output of the widget. I and others evidenced the problem to support but no answer.
I’m actually looking for an alternative as this behaviour of the widget is not acceptable.

![](https://secure.gravatar.com/avatar/ded0919164db2b55ee1116a6b64e18879d747704b11d2f9070fe53abbc2d2799?
s=60&d=retro&r=g)

### 󠀁[Not bad, but….](https://wordpress.org/support/topic/not-bad-but-9/)󠁿

 [Torgut](https://profiles.wordpress.org/torgut/) Oktober 19, 2016

It works properly, but it lacks a nice visual design and above all, for what it 
is, it’s not understandable how come it doesn’t display the date of publishing of
the posts.

![](https://secure.gravatar.com/avatar/128ac83cc932f5991435aca62c1b903164b5d75d262cf27b88fbe90677795528?
s=60&d=retro&r=g)

### 󠀁[Easy & Lovely!](https://wordpress.org/support/topic/easy-lovely/)󠁿

 [GoddessNYC](https://profiles.wordpress.org/goddessprojects/) September 3, 2016

Great options and easy to use! Looks great on the sites! Thank you so much!

 [ Read all 57 reviews ](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/)

## Contributors & Developers

“Flexible Posts Widget” is oopbron sagteware. Die volgende mense het bygedra tot
die ontwikkeling van hierdie uitbreiding:

Contributors

 *   [ DaveE ](https://profiles.wordpress.org/dpe415/)

“Flexible Posts Widget” has been translated into 3 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/flexible-posts-widget/contributors)
for their contributions.

[Translate “Flexible Posts Widget” into your language.](https://translate.wordpress.org/projects/wp-plugins/flexible-posts-widget)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/flexible-posts-widget/),
check out the [SVN repository](https://plugins.svn.wordpress.org/flexible-posts-widget/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/flexible-posts-widget/)
by [RSS](https://plugins.trac.wordpress.org/log/flexible-posts-widget/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 3.5.0

 * Major codebase rewrite to prepare for additional widgets, options.
 * Automatically updates any widget settings when the plugin is updated to a new
   version
 * Multi Language support (WPML & PolyLang)
 * Term selection box now uses built-in WordPress function [`wp_terms_checklist()`](https://codex.wordpress.org/Function_Reference/wp_terms_checklist).
   This provides support for visually displaying nested terms and brings the plugin
   into compliance with WordPress code.

#### 3.4.1

 * Version bump for WordPress 4.1 support.

#### 3.4

 * Added Finnish language support. (Props: @eccola)
 * Made the Template Filename field a select box based on the templates available
   in the current theme, the parent theme (if the current theme is a child theme)
   and the plugin’s views folder. (Props @w3b-beweb)
 * Added a new default template `Default.php` that works better in most sidebar 
   situations. The current default template `Widget.php` will be used by any existing
   widgets unless manually changed.
 * Added support to order posts by Modified Date.
 * Migrated admin CSS to SASS.
 * Much code clean up and refactoring.
 * Fixed an issue with language files not loading properly (Props @sajtdavid).

#### 3.3.1

 * Added plugin icon.
 * Version bump for WordPress 4.0 support.

#### 3.3

 * Refactored the PHP Class to encapsulate the plugin.
 * Added the ability to sort posts by “Post ID Order”. Useful when getting posts
   using the ID tab `post__in`. (Props: @cinus89)
 * Added Russian translation. (Props: @mizhgun)
 * Tested To bump for WordPress 3.9 support.

#### 3.2.2

 * Version bump for WordPress 3.8 support

#### 3.2.1

 * Added Italian language support. (Props: @adriano-esposito)

#### 3.2

 * Added option to ignore sticky posts.
 * Added support to get post by post ID directly.
 * Added Polish language support. (Props: @Invens)
 * Added a few filters: `dpe_fpw_args` to filter the query vars before submitting
   the query and `dpe_fpw_template_{$template_name}` to filter the selected template.

#### 3.1.2

 * Fixed several pesky PHP notices. (Props: @eeb1)

#### 3.1.1

 * Fixed incorrect use of rtrim in getTemplateHierarchy when getting custom template
   files. (Props: @mortenf)

#### 3.1

 * Internationalized and added Spanish language support. (Props: @elarequi)
 * Added support for Media post types with “image/” mime types to be displayed directly
   in the default template.

#### 3.0.2

 * Bug fix: Added a check to make sure both taxonomy & term are set for tax queries.

#### 3.0.1

 * Bug fix: Not able to get all registered post types & taxonomies until after widget
   init. Had to reorder some code.
 * Bug fix: when getting post types for display in widget admin. (Props: @angelfish276)

#### 3.0

 * Allow widgets to query by post type and/or taxonomy & term instead of just one
   or the other. (Props: @vernal)
 * Allow widgets to query by multiple post types and multiple terms within the same
   taxonomy. (Props: @vernal)
 * Changed the list of available post types and taxonomies from every possible option
   to just those that are public.
 * General UI enhancements for the widget admin.
 * Some minor code cleanup and security improvements.

#### 2.1.1

 * Fixed a source order bug in the widget.php template file. (Props: @carstenbach).

#### 2.1

 * Added offset parameter to display options.

#### 2.0

 * _Upgrade notice:_ When upgrading from v1.x.x to v2.x, remember to double-check
   the settings for any existing widgets.
 * Dynamically populate available terms based on selected taxonomy.
 * Make the “Get Posts By” section selectable and only show the chosen method: Taxonomy&
   Term or Post Type.
 * Miscellaneous admin improvements.

#### 1.0.5

 * Bug fix: Removed post_status ‘private’ from wp_queries. We don’t want to show
   private posts in our loops.

#### 1.0.4

 * Fixed an issue where post thumbnails aren’t displaying.

#### 1.0.3

 * Fixed PHP notices that showed in the admin when WP_DEBUG is enabled
 * Added some stub code for future admin JavaScripts (not active yet).
 * Readme.txt updates

#### 1.0.2

 * Readme.txt updates

#### 1.0

 * First public release

## Meta

 *  Version **3.5.0**
 *  Last updated **8 jare gelede**
 *  Active installations **8 000+**
 *  WordPress version ** 3.2 or higher **
 *  Tested up to **4.7.33**
 *  Languages
 * [Chinese (China)](https://cn.wordpress.org/plugins/flexible-posts-widget/), [English (Canada)](https://en-ca.wordpress.org/plugins/flexible-posts-widget/),
   [English (US)](https://wordpress.org/plugins/flexible-posts-widget/), en [Russian](https://ru.wordpress.org/plugins/flexible-posts-widget/).
 *  [Vertaal na jou taal](https://translate.wordpress.org/projects/wp-plugins/flexible-posts-widget)
 * Tags
 * [categories](https://af.wordpress.org/plugins/tags/categories/)[posts](https://af.wordpress.org/plugins/tags/posts/)
   [tags](https://af.wordpress.org/plugins/tags/tags/)[widget](https://af.wordpress.org/plugins/tags/widget/)
   [widgets](https://af.wordpress.org/plugins/tags/widgets/)
 *  [Gevorderde Aansig](https://af.wordpress.org/plugins/flexible-posts-widget/advanced/)

## Punte-toekennings

 4.6 out of 5 stars.

 *  [  48 5-star reviews     ](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/?filter=5)
 *  [  4 4-star reviews     ](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/?filter=3)
 *  [  1 2-star review     ](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/?filter=2)
 *  [  3 1-star reviews     ](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/)

## Contributors

 *   [ DaveE ](https://profiles.wordpress.org/dpe415/)

## Hulp

Got something to say? Need help?

 [Gaan na die hulp-forum](https://wordpress.org/support/plugin/flexible-posts-widget/)

## Skenk

Wil jy graag die ontwikkeling van hierdie uitbreiding ondersteun?

 [ Skenk aan hierdie uitbreiding ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJKSKHJWYAWDU)