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. Any way to get version 3.4 again? Updated to v3.5 and now siblings code is showing all children of "0" and is not excluding pages.

    Reply
  2. Is it possible to display image lists of a shortcode like [pagelist_ext child_of="122" class="listclass" image_width="120" image_height="80"] not below each other but side by side?

    Reply
  3. Is it possible using the shortcode parameters to specify something like parent depth?

    I have a sidebar setup to display subpages, but I want to limit the tree based on the level of page being viewed.

    So, for example, I'd like to just display parents and grandparents to the page i'm on. That would be 2 levels of parents.

    If I was viewing a page 5 levels deep, the Page list would only display the tree starting at the third level down.

    Possible?

    Reply
  4. Running Pagelist here:

    http://www.vaultcollectibles.com/tributes/

    as [subpages]

    looks great in all browsers except IE 9 (windows 7).

    (you would think IE 7 or 8 would have problems)

    The bullets line up on the left side of the page image and the list of subpages is on right side of image.

    Tried removing my custom css that styles text but no change.

    Any thoughts?

    Thanks for the cool plugin!

    -robert

    Reply
    • There are few ways to solve your problem:

      • float image to the right;
      • make a bullet of list items thru background image;
      • add this css-styles ul li {list-style-position: inside; margin-left:1em;}; Preview code;
      Reply
  5. Looking for a way to use this to show a map of all the pages on the site. I have tried several variations including:[pagelist_ext child_of="0" limit_content="100" image_height="60" image_width="60"]

    I only get an empty page.

    Reply
      • I fixed it. You may update your Pagelist plugin to version 3.5 and your shortcode [pagelist_ext child_of="0" ...] should work fine. You should see list of all pages on your site.
        Pay attention: [pagelist_ext] does not have hierarchy and it will show pages like flat list.

        Reply
        • "Pay attention: [pagelist_ext] does not have hierarchy and it will show pages like flat list."

          Yes, I discovered that, too. So I only include the direct children on a page with [pagelist_ext] with this seemingly counter-intuitive method, by adding the parent ID (see X below), which is simply that same page's ID.

          [pagelist_ext parent="X"]

          Reply
          • [pagelist_ext] shortcode is based on WordPress get_pages function and I tried to follow its logic. It has strange behavior with "parent" param (shows first level of children) and does not have "depth" param.
            P.S. You may use this more universal shortcode: [pagelist_ext parent="this"].

            Reply
            • Right! Thanks for that reminder! Pardon, the seemingly counter-intuitive was referring to that function.

              Aside: Wow, if it gets any thinner in here, I'm going to have to lose a few pounds...

              Reply
              • Yeah, I see, it is pretty narrow here :) I fixed it a little bit. TwentyEleven is pretty nice theme, but it is not build for deep discussions.

                Reply
  6. and another question...

    how can we get the links to open in a new window?

    (i am using the [subpages] shortcode)

    Thanks for the great plugin...

    Reply
    • There is no such function (opening in new window) in the plugin.
      You can do this by adding jquery code for doing this.

      Reply
  7. Hi, just wanted to inform you that the [pagelist_ext] shortcode doesn't show the title of a page if that page is written in greek characters.

    I hope this is fixed in the future :)

    Reply
    • Did you changed the code? If yes, so in which way?
      Does the titles include [div style="direction: rtl; text-align: right;"] or it is added by changed plugin?

      Reply
      • No, the code was not changed. The title includes the [div style="direction: rtl; text-align: right;"], yes, that's a bugfix, because the theme doesn't support rtl consequently.

        Reply
        • Your bugfix is breaking the code of the plugin.

          It would be more ease and correct if you will add needed styles to your styles.css

          Something like this: body {direction: rtl; text-align: right;"}

          And you should remove all html from page titles.

          I think after this Pagelist plugin and other staff on your site should work fine.

          Reply
  8. Is it possible to style 2nd and 3rd level sub-page items with indents while still showing sub-page content?

    For example:

    -Announcements Page

    Brief content here...

    -----Subpage 1

    Brief content here....

    -----Subpage 2

    Brief content here

    -Another Page

    Brief content here....

    I'm currently using the shortcode:

    [pagelist_ext child_of="943"]

    But with this shortcode I'm not able to apply CSS that will indent the 2nd/3rd level sub-page items.

    I know I can show hierarchy using the pagelist shortcode, but I'd like to include the page content.

    Thanks in advance :)

    Reply
  9. Heeeelp :-D

    A few hours ago I found your plugin.

    It's exactly what I want. Except ... a small thing. I absolutely need at the end of the intro text a "Read More" link to the page. The link in the title is not enough.

    I do not see this feature. I am not a coder, so I do not know if you can somehow make it.

    Can you tell me whether this is possible.

    Thanks for your effort.

    Kurt

    PS:

    Sorry for my bad English

    Reply
  10. Hi,

    thanks for this useful plugin.

    But I've a problem and don't know what to do...

    Everytime I want to insert the pagelist_ext plugin, nothing happens on my site.

    Could anyone help me?

    Thanks a lot! ;)

    Reply
    • [pagelist_ext] shows list of subpages by default.
      If you do not have subpages to the current page, than you can show list of subpages to another page (for example with ID="777") like this: [pagelist_ext child_of="777"]

      Reply
  11. Hi.

    I've got an error message, and don't have a clue how to fix it.

    Other wp-blogs, just simple uploaded and worked like a charm, but not with this theme ( Radial Premium )

    http://themeforest.net/item/radial-premium-automotive-tech-wordpress-theme/561152

    http://unit45host.com/soos/wp-admin/plugins.php?error=true&plugin=sitemap%2Fsitemap.php&_error_nonce=42a98d978f

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

    Fatal error: Cannot redeclare get_first_image() in /home/unit45ho/public_html/soos/wp-content/plugins/sitemap/sitemap.php on line 459

    Could you help, what, and where I have to change, eg chage permission on a folder or ?

    Thx, Zoltan

    Reply
    • Try to add this css code into your style.css:

      .page-id-2 .page-list-ext .page-list-ext-image {float:right; display:inline; margin:5px 0 10px 10px;}

      where ".page-id-2" - you should place the page id of your specific page.

      Reply
  12. Hello! Very useful plugin! Thanks!

    With single pages everything is ok. But I can't insert tree of posts from one category.

    Help me! Thanks!

    Reply
  13. I just installed the plugin, it is quite nice. Thank you!

    But, how to change the font, color and size for titles and description?

    I have bookmarked your site for future use. Thank you again!

    Reply
    • The plugin have basic markup and it try to use the default theme styles.
      If you want to change plugin styles you can add something like this to your main style.css file:

      .page-list {font-size:16px; color:#777;}
      .page-list-ext {font-size:18px; color:#555;}
      .page-list-ext h3 {font-size:22px;}

      Reply

Leave a Comment