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
1 vote
1 answer
61 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
87 views

wp_list_pages to show all pages on all sub pages

I have this code to list my parent page and all pages under it on the sidebar. It shows both parent and child pages on first two levels but when I open a third level page, it only shows the current ...
absolutelygradually's user avatar
0 votes
1 answer
143 views

Manually adding current_page_parent to wp_list_pages()

I'm using wp_list_pages() like so: <?php wp_list_pages('title_li=&include=1714'); ?> But would like it so that the link has a current_page_parent class under the following conditions: if (...
user avatar
0 votes
1 answer
23 views

build child and anchestor three from post parent

I'm trying to build a three menu from a custom post type, and wanna build a complet three from the posts children and parents, with all levels both up and down included. And actually the function ...
bymem's user avatar
  • 11
0 votes
1 answer
413 views

Change page name in admin list

One of my customer has many pages that have the same titles, although their content is different. They would like to be able to give them "admin titles" in order to differentiate them in the ...
Pierre's user avatar
  • 95
0 votes
1 answer
81 views

wp_list_pages two columns

I have a piece of code that splits my wp_list_pages navigation into two columns: <div id="head"> <ul> <?php $page_s = explode("</li>",...
Josh Rodgers's user avatar
  • 1,143
0 votes
1 answer
345 views

Why are array_slice() and array_chunk() not working?

I'm trying to build a nav out of an array of child pages from a custom post type called "section" with a parameter depth of 1. I want to slice this array so that it only displays a part of ...
bfoley_teamug's user avatar
0 votes
1 answer
58 views

Retrieve array items without page ID

I am using wp_list_pages to display our website's navigation. The nav is supposed to be 2nd level pages only. I want the nav to display the array's first four items and then nest the rest of the items ...
bfoley_teamug's user avatar
0 votes
1 answer
223 views

include specific Pages to wp_list_pages with filter

How can i make a simple filter to display only specific pages (include instead of exclude) as an output to wordpress pages widget? I made this code , but its not working function specific_pages($...
Honoluluman's user avatar
0 votes
1 answer
357 views

Get post and its children with WP_Query

I want the parent post and its children posts. I don't know the parent post ID, only that its post_password field is not empty. It's very similar to this question except the post ID is not known in ...
montrealist's user avatar
  • 3,054
0 votes
1 answer
224 views

Include parent page in list of child pages

I am trying to list pages for a specific ID but want to include the parent page in the list <?php $parent = 83; wp_list_pages( array( 'title_li' => '', 'child_of' =&...
user10980228's user avatar
0 votes
1 answer
439 views

wp_list_pages() exclude category

I tried adding this to a similar much older thread but didn't get a response so I am posting it as a new question. I have a large page based website that I am working on. Since it is mainly page ...
Phil's user avatar
  • 3
0 votes
1 answer
236 views

Post List by category and under custom taxonomy

I am trying to listing posts from a single category with custom taxonomy and several sub custom taxonomies. sub custom taxonomy "Knowledgebase" post KB 1 post KB 2 sub custom taxonomy "Optimization ...
Julham's user avatar
  • 11
1 vote
1 answer
107 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
0 votes
1 answer
495 views

wp_list_pages get the hole hierarchy for current page

Having for example the following page hierarchy Page1 - SubPage1_1 - SubPage1_2 -- SubSubPage1_2_1 Page2 - SubPage2_1 - SubPage2_2 -- SubSubPage2_2_1 and requesting for example ...
fefe's user avatar
  • 844
0 votes
1 answer
374 views

Exclude certain template from wp_list_pages

I'm trying to do something similar to the question in Exclude pages with certain template from wp_list_pages, but the $exclude variable doesn't seem to be returning the _wp_page_template value to then ...
Sketchybear's user avatar
2 votes
1 answer
677 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
1 vote
1 answer
259 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
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
2 votes
1 answer
316 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
  • 5,884
0 votes
1 answer
44 views

Creating navigation out of specific IDs and their children?

I'm looking for a way to list three specific pages in a nav-menu (I want to get these pages by their unique page ID's), and also list the children of these three pages - appended to each list item, in ...
W4yp01nt's user avatar
0 votes
1 answer
425 views

Create a list of pages excluding children of selected page

I am looking to find a way to create a list of the IDs of children pages from a selected page. My goal is to use the list of IDs so that I can exclude them from the following function: wp_list_pages(...
Peter's user avatar
  • 1
0 votes
1 answer
544 views

Check if the child page has sibling pages, and bookmark current page

I already check if the secondary page has sister pages and I show it in a list of sister pages within each secondary page, but when I am inside a sister page, in the list where I show it I want to ...
Marifer Villarroel's user avatar
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
0 votes
0 answers
49 views

Post list displaying wrong in Chrome and Firefox

I got a weird problem. My post list is displaying very weirdly in Chrome and Firefox. In Internet Explorer it surprisingly works. I guess it easier to show the behaviour with images: This is in ...
Tobias Glaus's user avatar
1 vote
1 answer
290 views

Combine get_page_by_title to exclude pages from wp_list_pages

I am using get_page_by_title to exclude a few pages from wp_list_pages, my code looks like: <?php $page1 = get_page_by_title('title1'); $page2 = get_page_by_title('title2'); ...
Josh Rodgers's user avatar
  • 1,143
0 votes
1 answer
63 views

Wrap each child and it's grandchildren separately

I need help separating the child pages, this is what I have right now: <ul class="children"> <li class="page_item page-item-54 page_item_has_children"><span>Title of Child1</...
user156's user avatar
  • 183
0 votes
1 answer
2k views

How can I list all page titles and IDs?

I currently use an sql query to produce a private page which lists all pages with their id. (It's a quick-check to help exclude some pages from search and site-map.) For easier formatting, I'm ...
glvr's user avatar
  • 851
0 votes
1 answer
1k views

Exclude pages with certain template from wp_list_pages

Before you mark this as duplicate I have tried every method in all the other questions and non of them have worked. I am trying to exclude any page with the page template page-noindex.php from the ...
Daniel Vickers's user avatar
0 votes
2 answers
5k views

Get parent of current page

please help me: I need to get the parent of the current page, in other words: to get the parent of $direct_parent.Thanks! <?php global $post; $direct_parent = $post->post_parent; $...
Perepelenok's user avatar
1 vote
2 answers
81 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,143
0 votes
1 answer
724 views

Display custom post types in wp_list_pages

I have a sidebar that displays parent, child and grand-child pages if they exist, I would like this to work on my custom post types. I have the following custom post types set up: Events, Blog & ...
Neelam Khan's user avatar
0 votes
1 answer
510 views

Remove and change pages label

I want to change the search pages label and remove the numbers of items. I Want also to modify the number of the visible pages on the listing of the pages now it's 20 pages. Solution : function ...
Samuel's user avatar
  • 324
0 votes
1 answer
606 views

Renaming wp_list_pages class

I am currently trying to change the outputted class that wp_list_pages is outputting. However, I don't wish to conduct a global change hence a simple filter is not an option i.e. Only this menu when ...
Colin's user avatar
  • 113
1 vote
1 answer
122 views

How would I add the comment count to this sub-pages of current page snippet

I have this snippet <ul> <?php global $id; wp_list_pages( array( 'title_li' => '', 'depth' => 1, 'child_of' => $id, '...
Pete's user avatar
  • 998
2 votes
1 answer
407 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
0 votes
1 answer
107 views

Thumbnails in ACF Query Results

I'm using pagelist_ext to list all pages under a specific category: http://thenorthshorescene.com/bands/ The list was getting long, so I created some additional pages that add another level of ...
Jake Nelson's user avatar
1 vote
1 answer
295 views

Combining 'depth' with 'include' in wp_list_pages()

I am using wp_list_pages to display my navigation that contains only specific top-level pages using the include parameter. However, I would like to display the child pages of those top-level pages. ...
user avatar
1 vote
1 answer
180 views

Listing child pages depending on user capability (role)

I need to list within a sidebar menu all child pages from the current parent page. The children pages are restricted for viewing by user roles, let's say "A" and "B" for now. I use the "Members Plugin"...
Simon's user avatar
  • 28
1 vote
0 answers
106 views

Help with Sub and Sub-Sub Navigation

I have utilised code from this posting: Display grandchildren on child and grandchild pages using wp_list_pages to create my menu here: http://new.leicesterymca.co.uk/youth-community/our-work/ As ...
Shaun Taylor's user avatar
0 votes
1 answer
219 views

Listing Child Pages in Random order

I am currently using a Plug-in that creates a "silo" structure for my website. It creates a sidebar with a list of the Parent page followed by the Child Pages. It only allows me to show the Child ...
jwklaudijr'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
0 votes
1 answer
44 views

Highlight Single Page Ancestor

I have a calendar called Event Organizer that I have been customizing: http://joshrodg.com/open/calendar/. You'll notice if you click on one of the blue events you are redirected to a page that looks ...
Josh Rodgers's user avatar
  • 1,143
0 votes
0 answers
128 views

wp_list_pages issue/bug?

So I created a theme for my company to use and was running it locally for quite some time, but recently moved to a live server and, as expected, some issues arose. Most of them pretty trivial and easy ...
Trenton Moore's user avatar
4 votes
6 answers
4k 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
  • 851
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
  • 635
0 votes
3 answers
2k views

wp_list_pages sort order by top nav menu order and child of

Im trying to show a box on left sidebar with links of current page's sub menus. but order is not applying same as menu! whats the problem? <div class="sidebar-box"> <div ...
Amino's user avatar
  • 323
0 votes
2 answers
3k views

List pages including both parent and child pages

I'm currently listing WordPress pages and child pages on a side widget using the following code. <ul class="side-links"> <?php wp_list_pages( array( 'title_li' => '' ) ); ?...
M1lls's user avatar
  • 117
1 vote
2 answers
892 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
2 3 4 5