Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
24 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 ...
2
votes
1answer
95 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 ...
1
vote
1answer
15 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 ...
1
vote
1answer
15 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 ...
1
vote
1answer
20 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 ...
3
votes
1answer
22 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 ...
0
votes
1answer
22 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 ...
0
votes
0answers
20 views

Creating navigation menu out of page-related parent/child/grandchild relationships

I am trying to create a sidebar navigation menu, that detects what pages are related to the page you are currently viewing, and then outputs the whole hierarchy of this family-tree inside a tiered ...
0
votes
1answer
64 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(...
0
votes
1answer
137 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 ...
1
vote
1answer
201 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: ...
0
votes
0answers
33 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 ...
1
vote
1answer
116 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'); ...
0
votes
1answer
22 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</...
0
votes
1answer
645 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 ...
0
votes
1answer
571 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 ...
0
votes
2answers
2k 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; $...
0
votes
2answers
61 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 ...
0
votes
1answer
384 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 & ...
0
votes
1answer
273 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 ...
0
votes
1answer
363 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 ...
1
vote
1answer
39 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, '...
3
votes
1answer
122 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 ...
0
votes
1answer
60 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 ...
1
vote
1answer
186 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. ...
2
votes
1answer
63 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"...
1
vote
0answers
66 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 ...
0
votes
1answer
133 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 ...
1
vote
2answers
793 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 ...
0
votes
1answer
33 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 ...
0
votes
0answers
67 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 ...
0
votes
2answers
734 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?
2
votes
2answers
950 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"></...
0
votes
2answers
765 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 ...
0
votes
2answers
2k 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' => '' ) ); ?...
0
votes
2answers
338 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 ...
0
votes
0answers
65 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 ...
1
vote
2answers
1k 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 ...
0
votes
2answers
54 views

PHP: Why does my code work in index.php but not a widget?

I have been working for 7 days straight to perfect code that generates a submenu on pages that have children. Since it was so complex I figured I'd write it in my index.php file and then migrate it to ...
0
votes
1answer
51 views

Displaying pages with a specific custom meta

Basically I have 3 Custom Meta checkboxes that I want to be able to filter by let's just use Member 1, Member 2, and Member 3 for these. The kicker however is that some may use 2,or even all 3 of ...
0
votes
1answer
2k views

How to add active class to custom menu using while loop and wp_list_pages

I am running wp_list_pages through a while loop to create a custom menu. By running it through a loop I can target specific elements to show. I need to figure out how to either target the classes ...
0
votes
1answer
104 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->...
1
vote
1answer
134 views

How to target grandchild of post_parent using wp_list_pages

I have a much larger problem I posted earlier (still unanswered) which I might be able to solve if I can find a way to target the grandchild (or third level post) of a parent post. Right now, this ...
1
vote
1answer
1k views

Show siblings (if any) and parents

My question relates to showing the parents and siblings of the current page. If I am on level 2 page, I would like to show siblings without their children. If I am on level 3 page, I would like to ...
1
vote
1answer
273 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 ...
1
vote
1answer
665 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 ...
0
votes
1answer
137 views

Using depth=n in wp_list_pages

I'm wondering what is the proper way to use depth n in wp_list_pages. I currently have a menu in my sidebar that goes 4 levels deep but I'd like to prevent levels 3 & 4 from displaying. The ...
1
vote
2answers
443 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 ) { $...
6
votes
6answers
8k 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. ...
0
votes
1answer
349 views

How can I list the current pages siblings and any ancestor page siblings?

For example, if this were my page structure: Food Vegetables Dairy Fruits Apples Bananas Kiwis Oranges Sports Hockey Baseball Football ...