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”

  1. Hi and thanks for a great plugin!

    I was wondering if it possible to have a "read more" link below the excerpt, using the pagelist_ext shortcode ? If not, would you be willing to build it in if you were paid? I have a project that needs exactly this.

    Please let me know.

    Reply
    • a quick and dirty way to achieve this:

      edit the file page-list.php, adding in line 354

      $content.="\n";

      $content.='read more';

      works in my project with

      [pagelist_ext strip_tags="0"]

      ... but naturally this is not update-proof :-(

      Reply
  2. A great plugin! I just wanted to know if there is there a way to disable the image and title being a URL and clicking through to the child page? I just wanted to display the children on the parent page with title, image and content but not link off anywhere. Thanks.

    Reply
  3. Hello

    and thanks for the great plugin!

    I am trying to build a breadcrumbs navigation where every crumb lists the alternative pages for its respective level of the trail in a dropdown menu (example: http://us.battle.net/wow/en/profession/cooking).

    The dropdowns aren't a problem but is there any way to GENERALLY list the 'parent' level and the 'grandparent' level of the current '(grand) child' page? Alternativly, when setting [pagelist depth="3"], is there a way of excluding levels 1+2?

    Thanks in advance!

    Reply
    • The problem is not in the Page-List plugin. The problem is in description tag and you are trying to be very SEO-friendly :)

      You are putting whole page content to meta description tag and WordPress is executing [page-list] shortcode in meta description tag too. That is why you have 2 lists of pages.
      You can easily remove meta description tag because nobody use it for many years.

      Reply
  4. On this page http://homesbyreliant.com/new-communities.html I have your plugin setup as

    [pagelist_ext show_first_image="1" image_width="150" image_height="150"]

    My question is there a way so the shortcode from the WordPress Post Tabs plugin does not display in the text ouput?

    Instead of reading

    "[tab:Community Info] Reliant Homes lends their..."

    Have it read (no shortcode in the content text)?

    "Reliant Homes lends their..."

    thanks,

    R.F.

    Reply
      • Thanks for the help.

        This is what I put in

        [pagelist_ext show_first_image="1" image_width="150" image_height="150" strip_shortcodes="0"]

        The same problem occurs.

        Reply
            • I solved the problem by turning on the excerpts functionality in my theme by placing this line of code in my functions.php.

              add_post_type_support( 'page', 'excerpt');

              Thanks for your quick responses and support.

              Reply
  5. I use this plugin extensively on most sites I do, it is invaluable.

    I'm curious why there is not depth="" parameter for pagelist_ext (it seems implied where the parent="" parameter is described). I've got a site where the content owners create ridiculously deep page structures, and typically I want a pagelist with a depth of 1 or (usually 1). I've gotten around it by using parent="XX" where "XX" is the page above the ones I want (rather than having to use a bunch of excludes)

    Thanks

    Reply
    • The answer is simple.
      Shortcodes [pagelist], [subpages], [siblings] are based on wp_list_pages() function which have depth param.
      Shortcode [pagelist_ext] is based on get_pages() function which have not depth param.
      I do not know why WordPress developers decided to have this set of params, but I cannot extend it easily.

      Reply
        • Yes, you are right, thank you for reminding about it.

          parent="this"; child_of="this"; exclude="this"; child_of="parent" and so on work for [pagelist_ext] shortcode too.

          I will add this to documentation during next plugin update.

          Reply
    • I did not understood what exactly you are trying to do.
      Can you explain what you are trying to do with more details?

      Reply
      • I can't seem to access your plugin from the back end of wordpress. Where do I actually edit the links or menu items? I can't seem to find it anywhere on the dashboard of my wordpress site. I just want to be able to edit it and yet there seems to be no way to do this?

        Reply
        • There is no admin section for Page-list plugin.

          You can change the behavior of the shortcode with shortcode options.

          The [subpages] shortcode shows all subpages to the current page automatically.

          Reply
  6. When using "include" (example... [pagelist_ext include="6,7,8"]) How is this used if the site is setup to use page names instead of id numbers? I trying to include a child page from a different parent page.

    Reply
    • Shortcode works the same even if you have url based on page names.
      Where you can get the id of needed page: go to that page while being logged in and press link 'Edit' in the top admin bar.
      Link should be something like this: site.com/wp-admin/post.php?post=777&action=edit - the id of the page here is '777'.

      Reply
  7. This is such a great plugin - thank you so much. I just wish there was a way to force images to be resized to fit within the pagelib-ext view rather than just cropping the central part of the image. Most of my images are banner-shaped and so they don't look great in the automatically generated lists.

    Any ideas on how I could accomplish this?

    Reply
  8. Wanting to use pagelist for a site map page, and I like it -- except that I can't seem to include custom post types. I tried using [pagelist_ext post_type="committee"] but it returned no results.

    Reply
  9. hi there,

    can you explain how can we show the date using [pagelist_ext]?

    What piece of code do i have to add.

    thanks

    Reply
    • There is no ability to sort pages by description. For sorting options check out 'sort_column' param on docs page.
      'desc' here means 'descending' and not 'description'.

      Reply

Leave a Comment