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.

44 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
1 vote
1 answer
168 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
1 vote
1 answer
296 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
0 answers
109 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
1 vote
1 answer
940 views

WordPress Side Navigation with Parent Heading and Child Sub Pages

I have the following navigational structure in WordPress: Page Sub Page Child Page Child Page Child Page Page Sub Page Child Page Child Page ...
Troy Templeman's user avatar
1 vote
0 answers
590 views

HowTo preserve page hierarchy with wp_list_pages()?

I have created a dynamic way of displaying "sub-menu-items" using the built-in function wp_list_pages(). However I'm stuck with the hierarchy of the pages displayed because of the sort_column doesn't ...
kelk's user avatar
  • 11
1 vote
0 answers
370 views

Get Parent List Class for Child Pages Using Walker

I'm having trouble getting child pages to use the parent li class whilst using wp_list_pages(). I'm using a walker to get the list classes to use page title, but no matter which way I try, I can't ...
user55100's user avatar
1 vote
0 answers
81 views

How to get Role Subscribe Users on Admin Menu only in Pages in Wordpress

How to get Role Subscribe Users on Admin Menu only in Pages in Wordpress and also asign pages to only a specific user and also get the pages on homepage by user ID. Example: here a link, i want to ...
Ahmad's user avatar
  • 11
1 vote
0 answers
70 views

need help with existing code showing subpages

I am helping a friend make some changes to a wordpress theme. At the moment displaying subpages works only for one parent and its subpages (the one with id 31), but we want it to work for all pages (...
Joanna's user avatar
  • 11
0 votes
0 answers
28 views

What's the WordPress way to get custom HTML for child pages list (with a second relative link)? Currently running regex over wp_list_pages() output

I use wp_list_pages() to output all the child pages of the currently viewed page. This works well enough but I wanted to add the comment feed URL with an icon next to each child page. My solution was ...
Matthew Brown aka Lord Matt's user avatar
0 votes
1 answer
25 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
400 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
59 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
247 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
243 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
0 votes
1 answer
45 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
450 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
0 answers
50 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
0 votes
1 answer
66 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
  • 193
0 votes
1 answer
221 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
0 votes
0 answers
136 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
0 votes
0 answers
387 views

Exclude pages by custom field (with yes/no) storing wrong data?

I might have a problem with the following codesnippet I came up with: 1.) I have a custom field (with custom fields plugin) that says YES or NO of "hide_menu_item" 2.) This is my loop to query the ...
mathiregister's user avatar
0 votes
1 answer
238 views

How to perform str_replace on the results of wp_list_pages

I am trying to target and replace the text produced by a function. I'm not too sure what I'm doing wrong. $InnerPages = wp_list_pages('child_of='.($post->post_parent != false ? $post->...
Heather's user avatar
  • 489
0 votes
1 answer
633 views

Exclude from wp_list_pages by template

I have a series of "Thank You" pages which result from different form submissions. I would like to be able to exclude these from sitemaps based on their template. Specifically, and as an easy example, ...
Carlos Espinosa's user avatar
0 votes
0 answers
120 views

How to display data with pagaination on backend?

I am new with WordPress development so I have no idea how to do this functionality with WordPress. I got one task to display some data from database and have to display records with pagination(Just ...
Avenger's user avatar
  • 229
0 votes
0 answers
16 views

Editing WP Plugin

I have a plugin that will has a dropdown box to select a post, but I want to change it so that it will select a page. Here is the original code. What do i need to change? <?php function ...
James's user avatar
  • 1
0 votes
1 answer
149 views

Wordpress get_pages sub nav show current page

I'm using get_pages in Wordpress to create a sub nav on a page. I know I can use wp_list_pages but I wanted to control the links at different screen sizes in bootstrap. Using this sort of code is it ...
user668499's user avatar
0 votes
0 answers
608 views

Wordpress list child pages of custom post type

Im stuck on this and any help would be appreciated. Say there is a parent page called "Stuff". And Stuff has several pages under it. Stuff more stuff more stuff1 more stuff2 It has no children ...
RMH's user avatar
  • 183
0 votes
0 answers
457 views

Change class name in Wordpress wp_list_page nav

I'm using Wordpress's wp_list_pages to display a nav of pages on the site. Some pages have children so I need a dropdown menu below those links. The html is something like this <ul class=""> ...
user668499's user avatar
0 votes
1 answer
423 views

wp_list_pages, links only for pages with no children

Is this possible to do, and what is a best practice solution? The things I can think of is parsing the page structure myself, or do it with JQuery to convert <a> to <span> or similar. Is ...
Henrik Erlandsson's user avatar
0 votes
1 answer
483 views

wp_list_pages change <ul> of children and anchor of parent

I am getting the list of Pages and Subpages by wp_list_pages(). I want to change the parent <a> and <ul> child. I found a solution here in this WPSE thread. But It only changes the <...
Rana Muhammad Usman's user avatar
0 votes
1 answer
242 views

How to use page metadata while using wp_list_pages()?

I'm creating my pages links in wordpress, using wp_list_pages(). each link contains an <i> tag which displays retina icons. I want to set a different class for each link in order to display a ...
user avatar
0 votes
1 answer
199 views

wp_list_pages - show pages immediately 1 level below current level

I'm setting up an events page in a wordpress site I'm building. Let's take a look at the page menu hierarchy: First of all there is a Events landing page. It will display four regions where events ...
rowefx's user avatar
  • 31
0 votes
1 answer
172 views

Get current post's child page?

Is it possible to find out what page a post is contained in? Im in my single.php template and im listing child pages in a sidebar using wp_list_pages, I want the page (not category) that the post is ...
user34466's user avatar
0 votes
1 answer
790 views

Non page link in wp_list_pages

I would like a navigation something like this. Home - People - About - Services - Contact Home, About, Services and Contact are all pages. People DOES NOT have a page, I would like to use this link ...
Simon Cooper's user avatar
0 votes
1 answer
119 views

How to make in post Parent page children page list nummbered

Parent page veggies Its children pages are carrots peas potato How to put in post numbered list of Parent page? Maybe better how to make same list to be ordered by date posted so some ...
Kangarooo's user avatar
  • 115
0 votes
0 answers
228 views

Display a custom post type list by taxonomy term

I need to show a list of custom post type classified by terms. The idea is something like this: Service list: <ul> <li> <a href="#">Webdesign (taxonomy term)</a> <...
Brightweb's user avatar
0 votes
0 answers
1k views

Check if meta_key exists in wp_list_pages

I have added a custom field (using Advanced Custom Fields plugin) to a page allowing you to show/hide it with a simple checkbox, i want to filter out these pages if a user is not logged in so i am ...
benpalmer's user avatar
  • 256
0 votes
1 answer
274 views

only display Pages which have children

Here is my website structure(wordpress pages) - HOME - - Tutorial - + PHP Tutorial + + Photoshop Tutorial + + Css Tutorial + + HTML Tutroial + - news - + November + ...
olo's user avatar
  • 101
0 votes
1 answer
111 views

Showing Custom Menus in the sidebar

I want to get custom menu in my top level page and the sub pages which are not child of the top level pages. I got many examples using wp_list_pages but it requires the sub pages should be the child ...
B L Praveen's user avatar
0 votes
1 answer
223 views

add a.parent in wp_list_pages

In relation to question posted here, is it possible to have an output to have something like this instead? where class="parent" is applied to the hyperlink? <ul> <li><a href="#"&...
Pabile's user avatar
  • 1
0 votes
2 answers
373 views

list child pages as slug

I have a section on my site that needs a list of pages that are descendents of a particular ID. I need them listed on the child and grandchildren pages. But the page titles are too long, so I need to ...
jamie's user avatar
  • 127
0 votes
1 answer
122 views

Is it possible to append an external html file to my wordpress navigation?

I'm trying to add a hardcoded 'megamenu' style dropdown div to my wordpress site. The content of the div itself doesn't need to be administered via wordpress, it will all be hardcoded. I don't want ...
V Neal's user avatar
  • 227
-1 votes
1 answer
1k views

Wordpress two row automatic sub navigation with double wp_list_pages. Is it impossible?

I'm working on large site with top-navigation menu for top-level pages only. Is there any way to make sub navigation menus work as on image attached? I hope the problem is in myinsufficient PHP-skills,...
user3299659's user avatar