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! how can I remove styles? I don't need this:

    those function doesn't work (but I think it should work..)

    wp_dequeue_style('page-list-style-css');

    wp_dequeue_style('page-list');

    Reply
  2. Subpages sort order:

    I have dropdown menus where the menu items are manually sorted in Appearance > Menus. I want [subpages] and [siblings] to produce the same order. I'm using this:

    [subpages sort_column="menu_order" sort_order="asc"]

    but it's not producing the same order as my drop-down menus. Am I misunderstanding the meaning of sort_column="menu_order"?

    Reply
  3. This: [pagelist child_of="this" number="3" depth="1" sort_order="desc" ] does not work! Why? Without "sort_order" – works, but incorrect! Any idea?

    Reply
  4. Can Page-List get the parent of a current child page? Something like:

    [pagelist parent_of="current"]

    In any event, thanks for a very useful plugin!

    Reply
      • No, that's the same as:

        [siblings]

        I'm using Page-List shortcodes in a sidebar text widget with conditional logic (enhanced text widget that parses PHP), to create a context-specific menu. If I'm on a siblings page, I want to generate a link to the parent page.

        The widget code looks like this, with a comment about what I want to do:

        post_parent > 0 ) {

        /* we're on a child page */

        /* **** here I want a link to the parent page */

        echo do_shortcode('[siblings]');

        } elseif ( is_page() && $post->post_parent == 0 ) {

        /* we're on a parent page */

        echo do_shortcode('[subpages]');

        }

        ?>

        Reply
        • Sorry, the code tag chopped off my "if" statement for some reason. I'm testing if a page is a child or not. It's not important to my question, but top line should have been:

          if ( is_page() && $post->post_parent > 0 ) {

          Reply
  5. Hi. I want to use your plugin in a sidebar widget to show a page's Featured Image (and nothing else) in the sidebar. It seems like this should work:

    [pagelist_ext include="this" show_image="1" show_title="0" show_content="0"]

    But that produces nothing. (I've also tried "current" rather than "this".) However, if I use the current page's ID, like this:

    [pagelist_ext include="26" show_image="1" show_title="0" show_content="0"]

    ... it works fine.

    But I want to generalize it so that the sidebar widget always shows only the Featured Image of the page that's loaded. Can I do that? Thanks.

    Reply
      • Currently there is just list of pages in the sitemap page, but i want that under products page it shows list of products in my site.

        Under products it shows products like this.

        Products

        Anti-Acne Wash

        Anti-Acne Solution

        Hydrator Serum

        Anti-Acne Trial Kit

        8 in 1 Whitening Sunscreen SPF 41 PA++

        7 in 1 Pore Refining Hydrator Serum

        Firm & Lift Serum

        e-book : How I overcame Acne and regained confidence.

        Reply
  6. Hello, great plugin - thanks

    Question:

    Is there a way to show the numbers of "subpages" on a page, like this:

    Normal:

    -------------------------

    - Page 1

    - - Sub Page 1

    - - Sub Page 2

    - - Sub Page 3

    =============

    New Output:

    --------------------

    - Page 1 ( 3 )

    Thanks for Feedback, Paul

    Reply
  7. Hi,

    is it possible to filter childpages by a certain content in a customfield?

    For example:

    Show only pages where country="us"

    thanks in advance

    michi

    Reply
  8. Google does not accept the sitemap I built on your code, due to the fact that "it is in HTML. Use a supported format." How can I correct this? :(

    Reply
  9. Hi

    Having an issue with formatting.

    Can be noticed when doing a search. Gradually, the formatting goes to hell the further down the page.

    I have noticed an extra tag near the closing tags for the pagelist.

    I cannot find the issue within the php code myself. All tags there seem to be matched.

    Here is the code snippet. Many thanks Mike

    Help NavigationGame Time List Help

    *** all inner tags are good from here ****

    Looks like a (or similar) tag is missing from the second nested list.

    Reply
  10. I am trying just to display the 1st level of the parent pages with their featured imaged using the following:

    [pagelist_ext hierarchical="0" exclude="279,358,276,2,5,52"]

    But I am getting all children pages.

    For example

    Page 1

    Page 1.1

    Page 2

    Page 2.1

    Page 2.2

    Page 3

    I want to only get Page 1, Page 2 and Page 3 returned. What am i doing wrong?

    Thanks

    Peter

    Reply
    • Try this shortcode: [pagelist_ext child_of="77" parent="77"] where "77" is ID of the parent page and you will get only its children and not grandchildren.

      Reply
  11. Hi

    Our website is using your plugin to display our site map, but I do not seem able to make it appear indented in the way your examples are.

    I get the different icon for each level of the map, but they are all left aligned.

    Could you point me in the correct direction to correct this?

    Many thanks,

    Sue

    Reply
    • Probably your issue is related to the theme and not to the Page-List plugin.
      Page-list plugin has only minimum amount of styles and the main part of styles is used from the theme.

      Reply
  12. When I use the [pagelist_ext limit_content="300"], there are some parts which shows the content more than that or even the whole content! I don't think I have any problems with the page itself.

    Reply
  13. how can I hide special tags? I use Nextgen. On the Category page, I see two images. The thumbnail of the first image and from the article..

    Reply

Leave a Comment