Wordpress Widget: My Pages Widget

Purpose of the widget

This Wordpress Widget is similar to the one previously posted on this website. It displays a list of pages depending on some options (mainly on page visibility settings). But there are two important differences:

  1. The first widget depends on the “Member Access” plugin. So it is not stand alone.
    But this widget is also not stand-alone: it can have multiple instances. Because of this it depends on my own MultiWidget Class plugin.
  2. I have never seen such a widget anywhere in the wordpress world. You have many options. For example there is an option to hide the complete widget, if there is no page to display. You can set the number of levels to display. Or you can set it to act as a subpage-navigation of the current page. And more!

How it works

The widget has the following options:

  1. The title that will be displayed in the sidebar
  2. The show option that decides which pages will appear depending on its ‘page_status’ (see below).
  3. The sort_by option. Pages can be sorted by ‘menu_order’, ‘page_title’ or the ‘ID’
  4. The depth parameter can be set to limit the number of levels to be displayed
  5. If the subpage option is checked then the widget will display only subpages of the current page
  6. And if the home_link option is activated, a link to the home page will allways be displayed.
  7. The whole widget can be hidden if it has no pages to display by setting the hide_if_empty bit.

The show‘option can be either

  • All Pages
    Displays all pages like the original “Pages Widget”
  • Allowed Pages
    Displays all public pages, plus all member pages only if the user is logged in (e.g. hides all member pages, if not logged in) (this is the default behavior of the widget)
  • Only Private
    Displays only private pages (the user is logged in or not)
  • Only Public
    Displays only pages that are NOT ‘private’

Hint

Remember that all options are combined together. Therefore this widget is highly customizable. Plus, there can be as many instances of this plugin as you like. Together with the ‘hide_if_empty’ function this lets you create clever navigation widgets depending on  the current page or the current user.

Download

Dowload link is HERE.

Please download the required MultiWidget Class plugin also.

Questions? Comments?

If you have any comments or questions regarding the plugin, please write a comment. I will answer as soon as possible.

Screenshot

Screenshot of the My Pages Widget

Screenshot of the My Pages Widget

Similar Posts:

Leave a Reply

Security Code: