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. Great plugin, except the one parameter I need is broken. I want to display four sibling pages. This works to show all of them:

    [siblings number="0"]

    But this breaks and shows nothing:

    [siblings number="4"]

    Reply
  2. Hello,

    I want to use your plugin for my website, but I have one question:

    Is it possible to show the results of example [pagelist child_of="133" in multiple columns? And if yes, can you explain how i can do this?

    Thank you for your time!

    Reply
    • If you want to split menu into (for example) three lists with 5 items in each you can try this shortcodes:

      [pagelist child_of=”133″ number="5"]

      [pagelist child_of=”133″ number="5" offset="5"]

      [pagelist child_of=”133″ number="5" offset="10"]

      Reply
  3. I'm using your plugin, but also have the "Exclude Pages from Navigation" (By Simon Wheatley) plugin installed.

    The pages I've excluded from the navigation are not showing up in the site map generated by your plugin. Is there a way to easily force your plugin to show all publicly published pages, even those I've excluded from the main navigation?

    Thanks

    Matt

    Reply
    • There is no way to force showing of excluded pages by "Exclude Pages from Navigation" plugin at the moment.
      Maybe this feature will be added in future plugin release.

      Reply
  4. Hello. Thank you for the plugin! I do need some help getting it to work. For some reason the second level children links are not working. When I check the code in the browser they are page links however they are not clickable. Please see here: http://www.littlefishmarketing.com/ccrlaw/sitemap

    Check the links under Attorney and Practice Areas. Any suggestions/help is appreciated. Thanks!

    Reply
  5. Hi, is there any way I could change the order of pages in the site map? It seems that pages are placed by alphabetical order, but I'd like to reorganize them by category.

    Reply
      • 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);
      • 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;
      Reply
  6. Is there any way I can make the site map display horizontally underneath my footer? I have it displayed vertically now...

    Thank you.

    Reply
  7. Hi

    Thanks for the plugin. I have installed but I am getting the following answer from Google Webmaster when I direct it to my site map page?

    "Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead."

    Thanks for any help?

    Reply
  8. Hi. I am a relative newbie to WordPress. Yesterday I installed your Site Map app, and don't know how to use it.

    Is there a simple instruction page that tells us dummies how to use the program?

    I see the "short code" menu pad in the Post segment; but it gives a full URL whereas I thought ...( )

    Please let me know how to use the app.

    Thank You,

    Richard @ Bizmarts

    Reply
    • If you want to show sitemap of your site, than paste this code: [page-list] ("page-list" in square brackets) into content of your Sitemap page and save it.
      If you want to show subpages of the current page, than paste this code: [subpages] ("subpages" in square brackets) into content of specific page and save it.
      Extra parameters and examples you can find here.

      Reply
  9. hello.

    great plugin... how i can delete the dots that appears on my list of [siblings] and set the list of pages in horizontal orientation and comma separated?

    i hope you can help me.

    Luis

    Reply
    • all your tasks can be done with CSS code:
      ul.siblings-page-list li {list-style-type:none; display:inline;} /* remove dots, move items in one line */
      ul.siblings-page-list li:after {content: ", ";} /* add comma to list */

      Reply
  10. Great plugin.

    The exclude_tree isn't working correctly, I believe. Works fine with just one ID, with multiple IDs, it only excludes the first tree.

    Reply
  11. I have this structure:

    menu item 1

    - level 1.1

    -- level 2.1

    -- level 2.2

    - level 1.2

    -- level 2.1

    -- level 2.2

    - level 1.3

    -- level 2.1

    -- level 2.2

    menu item 2

    menu item 3

    How can I write list of level 2 (level 2.1, level 2.1) of current level 1 only for menu item 1? Please help me. Thanks

    Reply
    • I don't really understand what you want to do.
      I will explain some parameters, which you can use in your task:
      [pagelist depth="2"] - get the tree of pages with 2 levels depth;
      [pagelist child_of="4"] - get subpages of the page with id=4;
      [pagelist child_of="this"] or [subpages] - get list of subpages to current page;
      You can combine these parameters to achieve your result.
      For example: [pagelist child_of="4" depth="2"]
      You need to add shortcode (for example [pagelist child_of="4" depth="2"] ) with needed parameters into your page content area.

      Reply
  12. I've installed the plug-in but I don't really understand how it is supposed to work. Is there any "getting started" documentation?

    My main question is after activating it, how do I use the sitemap? Is it a page that can be added to a menu and navigation? To "Edit" I only see a code editor... I haven't really gotten into shortcodes or scripting yet if that is required.... Thank you.

    Reply
    • You don't have to know coding for adding sitemap. For example you have page called "Sitemap" (or any other where you want to show the sitemap of your site). You are editing it and adding this code "[pagelist]" (word "pagelist" in square brackets) to the page content and save the page.

      This code [pagelist] will be changed into sitemap for visitors of this page.

      Thats it, you can open your "Sitemap" page in browser and you have the sitemap of your site on this page.

      If you need some extra parameters, you can find them here.

      Reply
  13. Hi. I've just installed the plugin, and it seems to be working fine with WP3.1.2.

    Just a quick request: can you add classes to the UL and LI's. I did so by adding it into your code, but if I, or someone else, applies an update, I'm sure we won't remember why the page-list suddenly looks wrong :)

    Reply
    • [li] items have classes added by WordPress.
      I added default classes to main parent [ul] item in the new 1.3.0 version of the plugin.
      You can also add your own class with this shortcode: [pagelist class="listclass"].
      So you are welcome to upgrade the plugin.

      Reply

Leave a Comment