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
0 votes
0 answers
9 views

List all files from subpages

My goal is to list all the pages names as well as the "attached files" of these pages on a separate overview page in wordpress. I have 100 pages with each between 0 and 4 attached PDF files (...
user avatar
0 votes
0 answers
16 views

Translate dashboard metabox

I create a dashboard metaboxes for the last published and drafted pages below the code i use : #dahsboard metaboxes #Last edited pages add_action( 'wp_dashboard_setup', '...
user avatar
  • 264
1 vote
1 answer
33 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 ...
user avatar
0 votes
1 answer
101 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
13 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 ...
user avatar
  • 11
0 votes
1 answer
122 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 ...
user avatar
  • 95
0 votes
1 answer
52 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>",...
user avatar
  • 1,115
0 votes
1 answer
235 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 ...
user avatar
0 votes
1 answer
57 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 ...
user avatar
0 votes
1 answer
136 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($...
user avatar
0 votes
1 answer
76 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 ...
user avatar
  • 3,004
0 votes
1 answer
130 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' =&...
user avatar
0 votes
1 answer
324 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 ...
user avatar
  • 3
0 votes
1 answer
188 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 ...
user avatar
  • 11
1 vote
1 answer
72 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" ...
user avatar
0 votes
1 answer
286 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 ...
user avatar
  • 822
0 votes
1 answer
253 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 ...
user avatar
2 votes
1 answer
542 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 ...
user avatar
1 vote
1 answer
160 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
1 vote
1 answer
26 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 ...
user avatar
2 votes
1 answer
234 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 ...
user avatar
  • 5,257
0 votes
1 answer
41 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 ...
user avatar
0 votes
1 answer
334 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(...
user avatar
  • 1
0 votes
1 answer
477 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 ...
user avatar
2 votes
1 answer
1k 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: ...
user avatar
0 votes
0 answers
41 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 ...
user avatar
1 vote
1 answer
265 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'); ...
user avatar
  • 1,115
0 votes
1 answer
46 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</...
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 ...
user avatar
  • 811
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 ...
user avatar
0 votes
2 answers
4k 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; $...
user avatar
1 vote
2 answers
79 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 ...
user avatar
  • 1,115
0 votes
1 answer
658 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 & ...
user avatar
0 votes
1 answer
479 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 ...
user avatar
  • 264
0 votes
1 answer
573 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 ...
user avatar
  • 113
1 vote
1 answer
103 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, '...
user avatar
  • 976
2 votes
1 answer
356 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 ...
user avatar
0 votes
1 answer
100 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 ...
user avatar
1 vote
1 answer
292 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
174 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"...
user avatar
  • 28
1 vote
0 answers
102 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 ...
user avatar
0 votes
1 answer
200 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 ...
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 ...
user avatar
0 votes
1 answer
42 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 ...
user avatar
  • 1,115
0 votes
0 answers
108 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 ...
user avatar
3 votes
4 answers
3k 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?
user avatar
  • 811
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"></...
user avatar
  • 625
0 votes
3 answers
1k 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 ...
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' => '' ) ); ?...
user avatar
  • 117

1
2 3 4 5