Skip to main content

Questions tagged [wp-list-pages]

This function displays a list of WordPress Pages as links. It is often used to customize the Sidebar or Header, but may be used in other Templates as well.

Filter by
Sorted by
Tagged with
8 votes
6 answers
26k views

Return parent post with its children using WP_Query?

In some cases it might be useful to use multiple post & page parameters in your WP_Query object. In my case, I would like to display children of a parent page including the parent page itself. ...
luukvhoudt's user avatar
7 votes
4 answers
1k views

How can I hide children of draft pages using wp_list_pages()?

I'm displaying a simple sitemap with wp_list_pages(); $args = array( 'sort_column' => 'menu_order', 'title_li' => '', 'post_status' => 'publish' ); wp_list_pages( $args ); The ...
mike23's user avatar
  • 5,981
5 votes
4 answers
25k views

Show just one level of child pages, wp_list_pages woe

I'm working on a site that has a fairly large page structure a few levels deep - in some sections there are a lot of pages. The basic setup is something like this... Parent Parent Parent -Child -...
a_kc's user avatar
  • 53
4 votes
2 answers
3k views

Shortcode producing headers already sent error

I've created a shortcode for a sitemap page. When I make a change on the page and click update I get a headers already sent error. Below is my shortcode and the two error messages. I'm wondering if I ...
brandozz's user avatar
  • 812
4 votes
6 answers
5k views

How can I list all pages with their templates?

I want to list all site pages with the template they use. Is there a mod to wp_list_pages which does this?
glvr's user avatar
  • 881
4 votes
1 answer
2k views

How to List All Pages (With their template names) Within a Website

I'm starting work on a legacy site, that has gotten quite messy. We'd sure like to clean things up. The site has 3914 page entries and with 27 different page templates. I kid you not. One thing ...
zipzit's user avatar
  • 316
4 votes
2 answers
849 views

Highlighting current item of custom post types' sub pages, listed by wp_list_pages

The below code is for listing the custom post types itself and its children in the sidebar. The code works great but does not highlight the sub pages. In functions.php: if(!function_exists('...
sez's user avatar
  • 41
3 votes
3 answers
5k views

How to hook wp_list_pages?

How can I hook the wp_list_pages function so that it reads a value of a custom field and displays it instead of displaying the page title?
Mohamed Said's user avatar
3 votes
1 answer
15k views

Is there a way to make a custom Page type?

In a theme I'm building, there are two main types of page. One is a product-gallery, one is for general info. I'd like to use wp_get_pages() or wp_list_pages() twice in the sidebar, one with a list of ...
Isaac Lubow's user avatar
3 votes
1 answer
427 views

How does wordpress calculate the page depth?

When using functions such as wp_list_pages(), WordPress gives you the depth option. How is it calculated? Is it stored somewhere in the DB? (I couldn't find it). Or is it calculated in a loop ...
gdaniel's user avatar
  • 3,251
3 votes
2 answers
6k views

Add class to the items in wp_list_pages

I just want to add a class for the active page in the wp_list_pages().Is it possible? If so can I provide a particular class for a active page. Here is my code for listing the parent page and its ...
user2754416's user avatar
3 votes
1 answer
2k views

Test if page is child and has children, if so echo child pages also on grandchild pages

I am trying to show a sub-menu of child-pages only on level 2 pages (who have a parent) and if they have children. I am using the code below (made from several snippets I found), it works fine on ...
xarai's user avatar
  • 75
2 votes
3 answers
556 views

Custom Post Type Name Causing Problem

Please ignore my poor English. I have custom post type (order). and its working like charm, But default post type (pages) list are not displaying in wp-admin side. You can see More information in ...
Akshay Paghdar's user avatar
2 votes
1 answer
705 views

Adding span tags within wp_list_pages list items

I am using this shortcode to produce a list of child pages of a specified parent. I would like to replace the list items default discs with a font awesome icon. According to the font awesome ...
Jalapeno Jack's user avatar
2 votes
1 answer
358 views

create shortcode to show children if any otherwise siblings

I'm trying to make a shortcode I can put into a widget that will show the siblings if there are any otherwise show the children. Here is my code I've started with: //sidebar siblings menu function ...
rudtek's user avatar
  • 6,143
2 votes
1 answer
2k views

Check whether the child page has siblings

Is there a way to check whether the child page has sibling pages. That is, whether they belong to the same parent page. If so, display the list of siblings pages within each child page. Example: ...
Marifer Villarroel's user avatar
2 votes
2 answers
2k views

inserting custom li class to wp_list_pages

I currently have a parent page with some child pages. I am able to list these child pages but would like to insert a custom li class. The wp_list_pages outputs <li class="page-item number"></...
steamfunk's user avatar
  • 645
2 votes
2 answers
1k views

Handling complex multi-level architecture / menu for large site

I am trying to get feedback and ideas for solving an information architecture / content management problem using wordpress. I have a large site ( 1,000+ pages, hundreds of posts ) made up of sections....
skim-'s user avatar
  • 637
2 votes
1 answer
418 views

No link on empty page in wp_list_pages

Currently I'm using <?php wp_list_pages( 'post_type=region&title_li=' ); ?> To get the hierarchical list of my custom posts 'region'. It works perfectly. I got this : Europe Belgium ...
Emersion's user avatar
2 votes
3 answers
150 views

How to get a list of all recently published child pages?

Can you please help me on how can I display a list <li> of newly published child pages. I've been looking on google how to use display it using the wp_list_pages(); but can't find out there. I ...
Kiko Lolo's user avatar
2 votes
1 answer
2k views

dynamically limit depth of wp_list_pages

I guess that this should be an easy one but I haven't yet find the proper solution. I want to limit the depth of wp_list_pages so as not to display the pages of the last level. So supposing that ...
vadims's user avatar
  • 353
2 votes
1 answer
332 views

Manipulate Output of wp_list_something: select menu instead of li's

I'm working on a responsive webdesign where my navigation should swap into a select-menu when resizing the window in smaller sizes. Is it somehow possible to add another param to functions like ...
mathiregister's user avatar
2 votes
1 answer
2k views

how to properly list child pages in sidebar?

My pages menu is maximum 3 levels deep and I am having a hard time figuring out how to properly list the child pages in the sidebar. If a page is a parent I want to list it's direct child pages and ...
user avatar
2 votes
0 answers
606 views

wp_list_pages sort order is different for different languages [closed]

I'm using the following code wp_list_pages(array('exclude' => '','title_li' => '','sort_column' => 'menu_order')) If I switch the language the sorting is different. One of the main menu ...
testing's user avatar
  • 651
2 votes
0 answers
885 views

Hierarchical Custom Posts - Highlighting Current Post in Sub-Menu

I have created a hierarchical custom post type called events and have used wp_list_pages to list the sub-posts for each event post (See below). This navigation works great, but I cannot figure out how ...
Susan's user avatar
  • 67
2 votes
0 answers
249 views

Conditional styling of wp_list_pages bullet points [closed]

I'm looking for some type of script that allows me to select custom image bullets for my wp_list_pages for 3 scenarios: If a page does not have a child If there are children If a page was recently ...
AlxVallejo's user avatar
  • 1,451
1 vote
3 answers
7k views

get all page IDs from wp_list_pages

I am looking for a way to output all page IDs from the following menu: <?php wp_list_pages('depth=1&exclude='3,5,11')); ?> Only top level pages needed, therefore the 'depth=1'. Any help ...
Kolli's user avatar
  • 13
1 vote
3 answers
3k views

How to echo excerpts with wp_list_pages?

I've tried to echo excerpts in wp_list_pages with the code below. It works, but only for one of the child pages. How would I echo the excerpt and title for each child page? <?php $children = ...
AndrettiMilas's user avatar
1 vote
2 answers
2k views

Setting multiple values to as sort_column

If I want to sort on 1) menu_order and if the pages weight the same I want to 2) sort them alphabetically, how? Is this the default behavior if you set menu_order? Is it?: $args = array( '...
OZZIE's user avatar
  • 113
1 vote
1 answer
2k views

Extra title output with this function wp_list_pages

here is the code : add_shortcode ('get_menu_child','get_menu_child'); function get_menu_child ($att) { global $wp_query; $thePostID = $wp_query->post->ID; $output = ''...
menardmam's user avatar
  • 882
1 vote
2 answers
2k views

wp_list_pages: only show subpages on the parent page?

I'm using wp_list_pages('title_li=') on my site. Some of my pages do have subpages, however I don't want to list them unitl I'm on an actual parent page that has subpages. So imagine my front-page: ...
mathiregister's user avatar
1 vote
2 answers
2k views

wp_list_pages(); Change output of hyperlink

I am creating a menu for a documentation site very much like this: http://getbootstrap.com/components/ I am using a hierarchical custom post type (manual). I am currently using wp_list_pages() to ...
Jonathan Pyle's user avatar
1 vote
2 answers
763 views

How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()

I want to add custom classes to my menu items. For every subpage I show its siblings as a navigation: global $post; if ( is_page() && $post->post_parent ) { $...
Mathias's user avatar
  • 53
1 vote
1 answer
813 views

wp_list_pages - Using a Walker to customize output order

I'm using wp_list_pages to create a navigation menu. I've run into a challenge with the menu order, though, and I am trying to figure out a way to take more control over the order of the menu. Is it ...
Jonathan Wold's user avatar
1 vote
1 answer
7k views

Change ul class="children" for wp_list_pages?

Hello I'm using this code to print a list of Pages and Subpages: <ul> <?php wp_list_pages('title_li=&depth=2&child_of='); ?> </ul> It outputs: <ul> <li><...
Shirou June's user avatar
1 vote
1 answer
72 views

Append a code when at the current page in wp_list_pages()

I'm using wp_list_pages() to show pages and subpages in a tree view and I need to add a "read more" as a sub-item right after the current page. Example: We are at the "Page tree" ...
Diana's user avatar
  • 1,238
1 vote
1 answer
2k views

List child pages of specific page using shortcode

I have written the function below to list the current pages child pages. Now what I am trying to do is list the children of a specific page using its slug in the shortcode. Is it possible to sneak an ...
Jalapeno Jack's user avatar
1 vote
1 answer
27 views

Custom category listings

Maybe the question is stupid sorry - I'm a beginner when it comes to WordPress. But... What do I have to do to have a separate page listing for articles from a given category? Do I need a special ...
simhumileco's user avatar
1 vote
2 answers
971 views

How can I include private pages in a page list?

I'm currently using wp_list_pages to show site pages. It doesn't include private pages, so I need to find a way to produce a list of them too. I can do it with a plugin, but it includes various ...
gulliver's user avatar
  • 123
1 vote
1 answer
601 views

Add anchor text to php

I am using this code to display a list of child pages of a parent: <?php global $post; // Setup the global variable $post if ( is_page() && $post->post_parent ) { // Make sure we ...
jecsh's user avatar
  • 11
1 vote
2 answers
345 views

Pages inside a page (with thumbnails)

I´m building a actors/movies sites and I got stuck with one thing. I have several pages with actors biography (featured image, name, about, date of birth, etc) and I have a menu with the option "...
Renato Augusto's user avatar
1 vote
1 answer
2k views

Display grandchildren on child and grandchild pages using wp_list_pages

On hierarchal pages 3 levels deep, I would like to display the grandchildren on child and grandchild pages (but not on the parent page). What I have so far displays the grandchildren on the child page ...
gstricklind's user avatar
1 vote
2 answers
509 views

Do Not Display Parent Page if No Subpages

This is the code from the codex most commonly used for sidebar menus. It displays the child pages of the top level ancestor and the ancestor itself. There is one thing about this code I would like to ...
AndrettiMilas's user avatar
1 vote
1 answer
148 views

Arrange Combined List of Pages and Categories

I'm using the code below to display both top-level pages and categories in my menu. (If this is the incorrect way to do so, please let me know). I would like to arrange the items alphabetically. The ...
AndrettiMilas's user avatar
1 vote
1 answer
2k views

Make wp_list_pages print slugs instead of titles

By default wp_list_pages spits out an unordered list of post titles. To save space in a sidebar menu I´m trying to create a list of page slugs instead of page titles. I suppose I´ll need to write a ...
Mattvic's user avatar
  • 929
1 vote
1 answer
128 views

I need ideas for a complicated menu

I have a slightly complicated menu to code from PSD document and integrate into wordpress. this is how it looks: (link in the comment bellow) The result of my work is this: http://slavisaperisic....
SlavisaPerisic's user avatar
1 vote
1 answer
237 views

List pages within a certain parent and show published month

How can I list all pages within a certain parent (ID=917) and show the month and year they were published in this format: Aug 2011 This is a page (link to page) This is another page (link) Jul 2011 ...
Rob's user avatar
  • 1,406
1 vote
1 answer
113 views

list pages using page.php and NOT page-{slug}.php

I made a view templates for specific slugs page1-220 use page.php contact uses page-contact.php service uses page-service.php Now I want to list the pages with their templates on a "overview" ...
Friedrich Siever's user avatar
1 vote
1 answer
306 views

How to get specified parent page title in my function

Below I have a function that prints the child pages of a parent. I am trying to obtain the specified parent pages title as a h2 above the unordered list. I have tried updating the title_li and also ...
Jalapeno Jack's user avatar
1 vote
2 answers
83 views

Highlight another nav item

I am using WordPress to develop a picture gallery website. I have albums and galleries, with different permalinks...http://url.com/albums and http://url.com/gallery, but only the albums appear in the ...
Josh Rodgers's user avatar
  • 1,173

1
2 3 4 5