Page-list

Advanced Iframe ProPage-listDonateGitHub

WordPress Pagelist plugin

Plugin helps you to show list of pages of your web-site with [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes. Very usefull for adding sitemap or list of subpages or list of products with thumbnails on your web-site.

Documentation

Shortcodes [pagelist], [subpages], [siblings] are based on wp_list_pages('title_li=') function and show hierarchical tree of pages;
You can use aditional parameters: [pagelist depth="2" child_of="4" exclude="6,7,8"].
Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The only difference is that [subpages] and [siblings] not accept child_of parameter, because [subpages] shows subpages to the current page and [siblings] shows subpages to the parent page.

Shortcode [pagelist_ext] is based on get_pages() function and show list of pages with featured image and with excerpt;
You can use aditional parameters: [pagelist_ext child_of="4" exclude="6,7,8" image_width="50" image_height="50"].

Parameters for [pagelist], [subpages] and [siblings]:

  • depth - means how many levels in the hierarchy of pages are to be included in the list, by default depth is unlimited (depth=0), but you can specify it like this: [pagelist depth="3"]; If you want to show flat list of pages (not hierarchical tree) you can use this shortcode: [pagelist depth="-1"];
  • child_of - if you want to show subpages of the specific page you can use this shortcode: [pagelist child_of="4"] where 4 is the ID of the specific page; If you want to show subpages of the current page you can use this shortcodes: [subpages] or [pagelist child_of="current"] or [pagelist child_of="this"]; If you want to show sibling pages of the current page you can use this shortcodes: [siblings] or [pagelist child_of="parent"];
  • exclude - if you want to exclude some pages from the list you can use this shortcode: [pagelist exclude="6,7,8"] where exclude parameter accepts comma-separated list of Page IDs; You may exclude current page with this shortcode: [pagelist exclude="current"];
  • exclude_tree - if you want to exclude the tree of pages from the list you can use this shortcode: [pagelist exclude_tree="7,10"] where exclude_tree parameter accepts comma-separated list of Page IDs (all this pages and their subpages will be excluded);
  • include - if you want to include certain pages into the list of pages you can use this shortcode: [pagelist include="6,7,8"] where include parameter accepts comma-separated list of Page IDs;
  • title_li - if you want to specify the title of the list of pages you can use this shortcode: [pagelist title_li="<h2>List of pages</h2>"]; by default there is no title (title_li="");
  • number - if you want to specify the number of pages to be included into list of pages you can use this shortcode: [pagelist number="10"]; by default the number is unlimited (number="");
  • offset - if you want to pass over (or displace) some pages you can use this shortcode: [pagelist offset="5"]; by default there is no offset (offset="");
  • meta_key - if you want to include the pages that have this Custom Field Key you can use this shortcode: [pagelist meta_key="metakey" meta_value="metaval"];
  • show_date - if you want to show the date of the page you can use this shortcode: [pagelist show_date="created"]; you can use this values for show_date parameter: created, modified, updated;
  • menu_order - if you want to specify the column by what to sort you can use this shortcode: [pagelist sort_column="menu_order"]; by default order columns are menu_order and post_title (sort_column="menu_order, post_title"); you can use this values for sort_column parameter: post_title, menu_order, post_date (sort by creation time), post_modified (sort by last modified time), ID, post_author (sort by the page author's numeric ID), post_name (sort by page slug);
  • sort_order - if you want to change the sort order of the list of pages (either ascending or descending) you can use this shortcode: [pagelist sort_order="desc"]; by default sort_order is asc (sort_order="asc"); you can use this values for sort_order parameter: asc, desc;
  • link_before - if you want to specify the text or html that precedes the link text inside the link tag you can use this shortcode: [pagelist link_before="<span>"]; you may specify html tags only in the HTML tab in your Rich-text editor;
  • link_after - if you want to specify the text or html that follows the link text inside the link tag you can use this shortcode: [pagelist link_after="</span>"]; you may specify html tags only in the HTML tab in your Rich-text editor;
  • class - if you want to specify the CSS class for list of pages you can use this shortcode: [pagelist class="listclass"]; by default the class is empty (class="");

Parameters for [pagelist_ext]:

  • show_image - show or hide featured image [pagelist_ext show_image="0"]; "show_image" have higher priority than "show_first_image"; by default: show_image="1";
  • show_first_image - show or hide first image from content if there is no featured image [pagelist_ext show_first_image="1"]; by default: show_first_image="0";
  • show_title - show or hide title [pagelist_ext show_title="0"]; by default: show_title="1";
  • show_content - show or hide content [pagelist_ext show_content="0"]; by default: show_content="1";
  • more_tag - if you want to output all content before and after more tag use this shortcode: [pagelist_ext more_tag="0"]; this parameter does not add "more-link" to the end of content, it just cut content before more-tag; "more_tag" parameter have higher priority than "limit_content"; by default the more_tag is enabled (more_tag="1") and showing only content before more tag;
  • limit_content - content is limited by "more-tag" if it is exist or by "limit_content" parameter [pagelist_ext limit_content="100"]; by default: limit_content="250";
  • image_width - width of the image [pagelist_ext image_width="80"]; by default: image_width="50";
  • image_height - height of the image [pagelist_ext image_height="80"]; by default: image_height="50";
  • child_of - if you want to show subpages of the specific page you can use this shortcode: [pagelist_ext child_of="4"] where 4 is the ID of the specific page; by default it shows subpages to the current page;
  • parent - if you want to show subpages of the specific page only you can use this shortcode: [pagelist_ext parent="4"] where 4 is the ID of the specific page and the depth will be only one level; by default parent="-1" and depth is unlimited;
  • sort_order - if you want to change the sort order of the list of pages (either ascending or descending) you can use this shortcode: [pagelist_ext sort_order="desc"]; by default: sort_order="asc"; you can use this values for sort_order parameter: asc, desc;
  • sort_column - if you want to specify the column by what to sort you can use this shortcode: [pagelist_ext sort_column="menu_order"]; by default order columns are sort_column and post_title (sort_column="menu_order, post_title"); you can use this values for sort_column parameter: post_title, menu_order, post_date (sort by creation time), post_modified (sort by last modified time), ID, post_author (sort by the page author's numeric ID), post_name (sort by page slug);
  • hierarchical - display sub-pages below their parent page [pagelist_ext hierarchical="0"]; by default: hierarchical="1";
  • exclude - if you want to exclude some pages from the list you can use this shortcode: [pagelist_ext exclude="6,7,8"] where exclude parameter accepts comma-separated list of Page IDs;
  • exclude_tree - if you want to exclude the tree of pages from the list you can use this shortcode: [pagelist_ext exclude_tree="7,10"] where exclude_tree parameter accepts comma-separated list of Page IDs (all this pages and their subpages will be excluded);
  • include - if you want to include certain pages into the list of pages you can use this shortcode: [pagelist_ext include="6,7,8"] where include parameter accepts comma-separated list of Page IDs;
  • meta_key - if you want to include the pages that have this Custom Field Key you can use this shortcode: [pagelist_ext meta_key="metakey" meta_value="metaval"];
  • authors - only include the pages written by the given author(s) [pagelist_ext authors="6,7,8"];
  • number - if you want to specify the number of pages to be included into list of pages you can use this shortcode: [pagelist_ext number="10"]; by default the number is unlimited (number="");
  • offset - if you want to pass over (or displace) some pages you can use this shortcode: [pagelist_ext offset="5"]; by default there is no offset (offset="");
  • post_type - [pagelist_ext post_type="page"];
  • post_status - [pagelist_ext post_status="publish"];
  • class - if you want to specify the CSS class for list of pages you can use this shortcode: [pagelist_ext class="listclass"]; by default the class is empty (class="");
  • strip_tags - if you want to output the content with tags use this shortcode: [pagelist_ext strip_tags="0"]; by default the strip_tags is enabled (strip_tags="1");
  • strip_shortcodes - if you want to output the content with shortcode use this shortcode: [pagelist_ext strip_shortcodes="0"]; by default the strip_shortcodes is enabled (strip_shortcodes="1") and all registered shortcodes are removed;
  • show_child_count - if you want to show child count you can use this shortcode: [pagelist_ext show_child_count="1"]; by default the child_count is disabled (show_child_count="0"); If show_child_count="1", but count of subpages=0, than child count is not showing;
  • child_count_template - if you want to specify the template of child_count you can use this shortcode: [pagelist_ext show_child_count="1" child_count_template="Subpages: %child_count%"]; by default child_count_template="Subpages: %child_count%";
  • show_meta_key - if you want to show meta key you can use this shortcode: [pagelist_ext show_meta_key="your_meta_key"]; by default the show_meta_key is empty (show_meta_key=""); If show_meta_key is enabled, but meta_value is empty, than meta_key is not showing;
  • meta_template - if you want to specify the template of meta you can use this shortcode: [pagelist_ext show_meta_key="your_meta_key" meta_template="Meta: %meta%"]; by default meta_template="%meta%";

607 thoughts on “Page-list”

    • Page-list plugin works only with pages.
      If you want to show posts, then try to search plugins with such functionality.

      Reply
  1. I need to display 3 meta_keys.

    I have tried this but it does not work

    [pagelist_ext child_of="574" image_width="150" image_height="150" show_meta_key="meta-a, meta-b"].

    Pls help

    Reply
    • [pagelist_ext child_of="574" image_width="150" image_height="150" show_meta_key="meta-a"]
      Now plugin can show only one meta key.
      Few meta keys is not supported for now.

      Reply
  2. Hello, Great plugin. I am using wordpress custom menus on my website. Does this plugin show hierachy top level/sub pages when using WP Custom Menus? Currently I'm only able to use [pagelist] which only lists all pages alphabetically and does not show heirarchy levels. Possible I'm entering the wrong shortcode - any suggestions? thank you, karen
    PS. I also have this website on a sub-domain

    Reply
    • Page-List plugin does not work with custom menues.
      It just shows list of all pages ordered by title for example.
      And custom menu is munu, created manually by user.
      I think, you should find another plugin, which will help you.

      Reply
  3. First of all awsome plugin.

    I have a question regarding the image feature. Is it possible to take for example the first image in a page/post instead of the featured image?

    This is similar to the subpages feature in Graphene.

    Reply
  4. I'd like to display subpages if you're at a top-level menu, and siblings if you're not. Is that possible?
    I was figuring that this might be it:
    if ( 0 == $post->post_parent ) {
    // call subpages
    }else{
    // call siblings
    }
    but I'm not sure how to call 'subpages' or 'siblings' directly.

    Can you clue me up?

    Cheers

    Reply
    • try something like this:

      [php
      if ( 0 == $post->post_parent ) {
      $args = array( // subpages
      'child_of' => $post->ID,
      'title_li' => '',
      );
      }else{
      $args = array( // siblings
      'child_of' => $post->post_parent,
      'title_li' => '',
      );
      }
      wp_list_pages( $args );
      php]

      Reply
  5. Great plugin. I am running into an issue, however, where I want to only show the children of the current page, not the children of the children. If I do [pagelist_ext show_content="0" hierarchical="0"], I still get the children of the children listed. Am I doing something wrong?

    Reply
  6. Hi,

    I am using the pagelist_ext shortcode to display featured images in the list but I would like to indent the child pages instead of having them all at the same indentation as it is confusing not being able to 'see' the page hierarchy.

    Is there a simple update to the css that I can use as it seems that this plugin effectively strips the html of any tags that I could have used to customise the css myself.

    Reply
    • [pagelist_ext] is based on get_pages() function and it is not supporting hierarchy.
      At least yet. Maybe it will be in future.

      Reply
  7. I'd like to use the pageinfo_ext options for one set of my pages, with a limited depth, but it looks like pageinf_ext does not allow for depth modification, is this something planned or undo able? Or am I missing how to change the depth on pageinfo_ext?

    Reply
    • [pagelist_ext] is based on get_pages() function and there is no ability to specify depth parameter, it is unlimited by default.
      But you can set depth to one level only if you will specify "child_of" and "parent" parameters the same.
      There is no other options for depth.

      Reply
  8. I just upgraded WordPress to 3.3.1 and in the process updated the page-list plug-in to the latest version, but it refused to reactivate, giving this error:

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare pagelist_add_stylesheet() (previously declared in wordpress/wp-content/plugins/sitemap/sitemap.php:19) in wordpress/wp-content/plugins/page-list/page-list.php on line 20

    Any thoughts or suggestions?

    Reply
    • deactivate "Sitemap" plugin and than you can activate "Page-list" plugin.
      The code in those plugins is the same (fuctionality is the same too) so it creates conflict.
      At the same time could be active only one plugin: or "Sitemap", or "Page-list".

      Reply
  9. One general tip in case it helps anyone else. To use these shortcodes in a widget area, add this to your theme's functions.php: add_filter('widget_text', 'do_shortcode');

    Some other plugins (e.g. J Shortcodes) may already take care of this for you but if you see the shortcode itself when using in a widget area, add this yourself.

    Reply
  10. Hello again,

    Really liking the flexibility but do have a request to make: when you show excerpts using [pagelist_ext], could you make the excerpts link to the Page if Show_Titles="0"?

    I'm showing a list of excepts without titles but there's no way then to get to the actual page from this list.

    Thank you!

    Reply
  11. Hello,

    Great plugin. One FYI that the [pagelist] "number" parameter does not work if you also use "child_of".

    Thanks!

    Reply
  12. Great plug-in! Is there a way to get paginated results. I have 110 child pages that I would like to call using the page_ext function. I tried the 'number=12' argument but that resulted in a page with 12 pages listed and no 'Next' link at the bottom of the page. Am I missing something?

    Thanks!

    Reply
    • I am sorry, but pagination is not supported and I did not know if it will be in future. If I will add it to the plugin, I'll let you know.

      Reply
  13. Hello,

    Could you possibly also add the call of the function page_list_parse_content to the processing of the post's title? I have to redo it each time after updating your plugin, because if I have "" charachters in the page title, they break up my HTML code.

    Reply
  14. Thank you for this plug-in!
    "Shortcode [pagelist_ext] is based on get_pages() function and show list of pages with featured image and with excerpt;"

    I took this to mean that the list would/could use the post "excerpt" field rather than the post content.

    i.e. $page->post_excerpt versus $page->post_content

    Is there a way to do this now in the tag? In other words to use the manual excerpt instead of the content.

    I modified the plug-in to do this for my special case. But of course if it is possible already, please let me know how.

    Alternatively, that would make a great option to the tag... use_manual_excerpt="1"

    Thanks!

    Reply
    • Thanks for your feedback.
      I fixed it in version 2.3.
      Now [pagelist_ext] shows excerpt, and if excerpt is empty, than the content is shown instead.
      You may test it.

      Reply
  15. I posted this on WP.org site... When first using this plugin i faced this error: when using the [Pagelist_ext] get the following error message:

    Fatal error: Call to undefined function get_the_post_thumbnail() in ...wp-content/plugins/page-list/page-list.php on line 288.

    I intitall worked around this by adding in show_image="0" as in [pagelist_ext show_image="0"].

    The problem showed up when a page does not have a featured or thumbnail imagine.

    Now I don't know if this was fixed in an update (1.19) because I don't have to specifiy imagine as "0" anymore.

    Now I have new problem.
    When using [pagelist_ext] and specifying a number such as [pagelist_ext number="2"] it doesn't display anything. Additionally when using other function such as [pagelist_ext offset="1"] also results in nothing being displayed.

    This is the only code i have displayed on the page. Each subpage only have one sentence. So tehre should be no reason nothing is displayed. I have 4 sub pages. All display correctly when just using [pagelist_ext]

    Reply
    • You can use a plug in called "List category post" that does what you want. In fact the that plug in and this one seem very similair in concept, would be nice if they both worked for posts or pages.

      Reply
  16. Hi,
    I just installed the plugin. Please guide me where to add the code, to get the sitemap in my side bar ? can you please help me with a sample code. I tried creating a page called Sitemap and typed the code, what was given in the plugin site (first code). But It displays nothing.

    Please guide me !!
    Thank you in advance.

    Reply
    • Sorry, but Page-list plugin does not add widgets to sidebar.
      It can only add sitemap to page content if you will add this shortcode [pagelist] into "Sitemap" page content.

      Reply
  17. I'd like to use the pageinfo_ext options for one set of my pages, with a limited depth, but it looks like pageinf_ext does not allow for depth modification, is this something planned or undo able? Or am I missing how to change the depth on pageinfo_ext?

    Reply
    • [pagelist_ext] have no depth parameter for the moment, because it is based on get_pages() wp function.
      By default the depth is unlimited. But if you will set "parent" and "child_of" parameters the same you will get one level depth.
      There is no more other options for depth for now.
      But I think I will add depth parameter in future.

      Reply

Leave a Comment