Flexi Pages Widget
Download Latest version: 1.4.1 (updated on 21 May 2008)
Flexi Pages Widget is a highly configurable widget to list pages and sub-pages in WordPress sidebar. User friendly widget control comes with plenty of options. ‘Flexi Pages’ widget can be used as an alternative to the default WordPress ‘Pages’ widget.
Features
- Option to display sub-pages only in parent page and related pages.
- Option to easily select and exclude certain pages from getting displayed in the list. Alternatively, only certain pages can be displayed by using the ‘include’ option.
- Option to include a link to the home page.
- Other options include title, sort column/order, text to be displayed for home page link, other display and depth options.
- Multiple instances of the widget — upto nine instances of the widget can be added to the sidebar
- Instead of using the widget, the function
flexipages()can be called from anywhere in the template (more information).
Screenshots
Click on a thumbnail for full size image.
- Controls for Flexi Pages Widget
- Pages listed on the home page when “List sub-pages only in parent and related pages in the hierarchy” option is selected.
- Pages listed on a page having sub pages. You can see the sub-pages expand here while only top level pages are listed in the home page on screenshot 2. Same settings as screenshot 2.
Download
Requires atleast WordPress version 2.1. Tested upto WordPress 2.5
Downloaded a total of 4567 times
You are free to use the plugin under terms specified by GPL.
If you like the widget and find it to be useful, please consider making a donation. Any amount will be thankfully accepted.
Installation
- Unzip the compressed file and upload ‘flexi-pages.php’ file (or ‘flexi-pages’ directory) directory to the ‘/wp-content/plugins/’ directory
- Activate the plugin ‘Flexi Pages Widget’ through the ‘Plugins’ menu in WordPress admin
- Go to WP Admin » Presentation » Widgets, drag ‘Flexi Pages 1′ widget into the sidebar and choose your options
- An option to select multiple instances of the widget is available in the widgets page. You can have upto 9 instances of the widget
Contact me for suggestions/questions/feature requests/bug reports. You can also leave your message here as a comment.
The flexipages() template function
Instead of using the sidebar widget, the function flexipages() can be used as a template function to display the list of pages. All options available for wp_list_pages() can also be used for flexipages(). Additionally in flexipages(), the depth parameter has two more choices (-2 and -3), and there is an extra parameter to display a link to the blog home page.
depth (integer)
This parameter controls how many levels in the hierarchy of pages are to be included in the list generated by flexipages. The default value is -2.
- 0 - All pages and sub-pages displayed in hierarchical (indented) form.
- -1 - All pages in sub-pages displayed in flat (no indent) form.
- -2 (Default) - List sub-pages only in parent and related pages in hierarchy.
- -3 - Similar to ‘-2′ above, but siblings of parent pages won’t be displayed. Only top level pages and pages in the hierarchy will show up.
- 1 - Show only top level Pages
- 2 - Value of 2 (or greater) specifies the depth (or level) to descend in displaying Pages.
home_link (string)
If a value is specified for this parameter, a link to the home page of the blog will be displayed on top of the list of pages. The link text will be the value specified. For example, flexipages('home_link=Home') will display a link to the home page with link text as ‘Home’.
In addition to the above two, all other parameters used with wp_list_pages() can also be used with flexipages(). Refer WordPress documentation for more details about the wp_list_pages() function and to know about how to pass the parameters into the function.
Frequently Asked Questions
- After selecting a few pages for exclusion, isn’t it possible to deselect all pages? There is always one page selected for exclusion.
- It is possible to deselect all pages. Hold the ‘Ctrl’ key in your keyboard and click on the name of the page that’s not getting deselected.
- When the option “List sub-pages only in parent and related pages in hierarchy” is selected, top level pages, children and siblings of the current page, and siblings of the parent page get listed. Is it possible to get rid of siblings of parent page on a subpage while using this option?
- Yes. But you have to select the ‘Custom depth level’ option to achieve this. Enter the number ‘-3′ for custom depth. This way only top level pages and pages in the hierarchy will show up.
- Is there an option to list only sub pages and hide the parent pages?
- Although such an option does not exist, the ‘Include’ option can be used to achieve this. Select ‘Include’ instead of ‘Exclude’ and select all the pages you want to be listed. Pages left out won’t be displayed.
Change Log
2008-05-21: Version 1.4.1
- Bug fixes (issues regarding include/exclude sub-pages only with ‘List sub-pages only in parent and related pages in hierarchy’ option.)
2008-04-06: Version 1.4
- Fixed the odd behaviour when the widget is placed below the recent posts widget.
- Removed the redundant check box for home page link in widget controls
- Tested with WordPress 2.5; widget control box styling compatible with WP 2.5
2008-02-19: Version 1.3
- Multiple instances of the widget
- Added ‘Include pages’ option
flexipages()template function- Other minor improvements
2007-08-31: Version 1.2
- Added option to provide a custom text for the home page link
- Custom depth of ‘-3′ will display only parents, siblings and children along with top level pages. Parents’ siblings wont be displayed.
- Few other improvements and some optimization.
- Tested with WordPress 2.3-beta1.
2007-08-22: Version 1.1.2
- Fixed the missing
</li>tag for home link - Added class name (page_item, current_page_item) for home link
2007-08-17: Version 1.1.1
- bug fix
- tested with WordPress 2.2.2
2007-08-12: Version 1.1
- bug fix
2007-08-08: Version 1.0
- Initial release








#121: Dheer says:
Hi Srini,
I really like this plugin and was attempting to use your code to create a similar widget for tag clouds (basically passing args for wp_tag_cloud()). Unfortunately my experience with plugins is not too good and was hoping to know if it would be possible for you to help create such a plugin.
In my case I have over 300 tags and I am attempting to only include a few tags to display in the form of a list (type=list).
Do let me know if a solution may be possible or is you could set me off in the right direction.
Regards,
Dheer
#120: Srini says:
Esther, thanks for the feedback.
All top level pages should be displayed for level 2 unless excluded. Is there anything special, anything different about the page that’s left out? If the older version works well for you, you can continue with that, but if you can provide more details about the page structure and the options you have selected, I will try and find out if there is a defect with the plugin. You can contact me or email me, the address is this domain at gmail.com.
#119: Esther says:
Hi Srini,
thank you for one of the most useful plugins! However, after upgrading to the latest version one page was not displayed anymore. I have flexipages set to custom depth level 2 and want to include the top level pages of a certain category only. For some reason one of those top level pages was not displayed anymore (I repeatedly tried to include it to no avail). After downgrading to the latest version everything is now working fine again. Any idea what the reason could be?
Keep up the good work … great plugin!
Thanks,
Esther
#118: Srini says:
jimg, chris and Kristian, the issues are resolved now in 1.4.1
hunter, I have tested the plugin extensively with 3col themes and it seems to work perfectly. It would be helpful if you can provide details of your page structure and the options you select for the different instances of the widget you use. It would also be good if you can provide a link to the site where you are using the plugin, or at least a screenshot. You can contact me or email me, the address is this domain at gmail.com.
#117: hunter says:
Hello Srini,
I have been searching a long time for a way to build a system in the quite complicated web-structure which I am using. Your widget helped me a lot, thank you! Unfortunately I have encountered a problem and I wasn’t able to solve it although I spend a few days with it.
I’m using flexi – pages in a three-column template. Your widget is placed in the left sidebar right three times below for different page themes. The problem is that, if I click in one widget on any page, a structure of sub –pages unrolls. But the structure of the sub-pages unrolls in the other two widgets too; in fact the whole structure of all three widgets unrolls. And I want to unroll only the sub-pages under the page on which I clicked. I hope that I explained it understandable. If you know how to solve this problem please let me know, I will be very grateful to you.
Thank you and greetings
#116: Kristian says:
Great Plug-In!
But there seems to be a problem when I Include pages. If I use Exclude, everything works fine, but the otherway around the sub-pages wont show. A simple soution would be to just use the Exclude function, but when using the Plug-in “Private Post” I need to be able to include pages, when the to plug-ins does not work very well together..
#115: OGM 20 Plugins being used says:
[...] Flexi Pages Widget [...]
#114: chris says:
thanks Srini, looking forward to hearing from you. cheers!
#113: Srini says:
Marglar, styling largely depends on the theme you are using. It’s very difficult to have a styling guide that fits all the themes. I think you gotta experiment a lot more
… look up http://www.w3schools.com/css/css_reference.asp for help.
Shane, no idea why this happens.
chris, let me answer you a little later.
#112: chris says:
first off, dandy plug-in!
is there any easy way to not display the title if there are no sub-pages to list?
i would like to use this for sub-pages only so i have excluded all top-level parent pages and used the list sub-pages only option.
the thing is i do have some pages without sub-pages and for these pages it still displays the title without any pages to list.
thanks!