Tagged Questions

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.

learn more… | top users | synonyms

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

Format Specific Link in wp_list_pages

I am implementing a custom walker for wp_list_pages. I would like to implement the following logic inside the walker: IF PageID=X THEN use output A IF PagID=Y THEN use output B. The code of my ...
0
votes
1answer
72 views

Using wp_list_pages to create 2 lists of pages and include and exclude some of them depending on their category

I would like to create 2 lists of pages and include and exclude some of them depending on their category. In the following example, I have my 2 lists. A list of promoted pages and a list for the rest. ...
1
vote
1answer
30 views

List pages to show only Whitelisted sub pages

In my custom theme I want to show all parent pages but for a few of those parent pages I don't want to show their subpages. I know you can add all these subpages to the 'exclude' argument of the ...
0
votes
3answers
70 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 ...
0
votes
0answers
15 views

dispaly page order with page name in custom post template

Hi i am building a custom template to show the list of pages names with link to the page, do we have any chance to show its parent and its menu order. by using wp_list_pages
0
votes
0answers
12 views

Auto-build First Instance of Menu from Page Structure

I am wondering if there is a way to build a custom menu that is initially populated by the current page structure. I am working on a site that was initially build pre-custom menus, but now we want to ...
0
votes
0answers
36 views

wp_list_pages show all pages in sitemap

I am trying to list the pages of my site but actually list them all. I can use wp_list_pages(); However I have a custom post type "services" with archive false. I also have a page named services ...
0
votes
1answer
36 views

WP List Pages - Add Title Attributes to Anchors

Using the default wp_list_pages() is there an easy way / filter to add title attribute to the anchors? Right now it just spits out the anchor with no title attribute but I would like to add it on ...
0
votes
0answers
32 views

How to show custom post type in page hierarchy?

Is it possible to show a list of pages with a custom post type included in that list if it's parent is a page? So if I was using the query more specifically something like get_pages(), ...
7
votes
4answers
223 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 ); ...
0
votes
1answer
17 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 ...
1
vote
2answers
146 views

Change Parent Name with wp_list_pages?

I use the following line in a code which outputs subpages and a parent. This code outputs the name of the parent page. I would like to replace this with the word "Overview." How do I achieve this in ...
0
votes
0answers
40 views

Showing anchor links in sidebar for headings only on a certain page

I want to be able to add anchor links to header ids in one of my WordPress pages, and then show links to those ids in the sidebar. The sidebar is built like this in content-page.php: <?php ...
0
votes
1answer
46 views

Subpages List Appearing on Every Page

This code displays the parent page and a list of its subpages, but not the grandparent page. (It is the second red menu in the left sidebar here). There is one problem with this. This code outputs a ...
0
votes
0answers
66 views

How to slidedown and slideup child pages clicking on parent pages in jquery or javascript?

I have created a sidebar in wordpress in which all parent pages with subpages are listed. I have used following code in sidebar-left.php file and call this in template file. <div id="primary" ...
0
votes
0answers
70 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 ...
0
votes
0answers
45 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=""> ...
0
votes
2answers
23 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 ...
0
votes
1answer
176 views

How to display list of child pages with parent in wordpress?

I have following format of sub-pages in WordPress: About Us -Services -Products -Surgery I want to list all sub-pages with parent page like above but the code that I am using from ...
1
vote
0answers
48 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 ...
0
votes
1answer
104 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 ...
0
votes
0answers
22 views

Walker only returns one child page

I'm trying to create a menu on a page showing all of its sub-pages. I want to add an image to the link so I'm using a walker to edit the output of wp_list_pages. But when I call the walker only the ...
0
votes
1answer
106 views

How To List Sibling Pages And Include The Featured Image?

I recently came across this cool tutorial on listing sibling pages. Below is the suggested code: <?php //GET CHILD PAGES IF THERE ARE ANY $children = get_pages('child_of='.$post->ID); ...
0
votes
0answers
34 views

External link nested in wp_list_pages

I'm using wp_list_pages to return the children of a page. I want to 'replace' one of the returned links with a link to an external page. Currently I am using exclude to exclude the page I wish to ...
0
votes
1answer
67 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 ...
0
votes
1answer
44 views

Get whole <li> linked with wp_list_pages

I'm using wp_list_pages for my sidebar and it works fine to me, i just wanna add new feature which seems is not listed on codex or i don't know how to use it. $args = array( 'child_of' => ...
0
votes
1answer
31 views

List all Posts under heading in wp_list_pages menu

I am currently using the default Page Navigation (wp_list_pages) with wordpress and I have set my homepage to a page called "Home" and my blog to a page called "Events" but I would like to list the 10 ...
0
votes
0answers
117 views

Get Next/Previous (Sibling) Top Level Parent Page Id - Wordpress

Question: Is there any possibility to get next/previous page id in wp_nav_menu in wordpress. Example: I have navigation menu like this Menu_Item_1 (ID = 5) >SubMenu_Item_1-1 ...
0
votes
1answer
17 views

Post Fetching Ignoring Sort_Column?

I am using the code below subpages for my portfolio. For some reason, it seems to be ignoring the ordering I have set on my pages. Any help? <?php $args = array( 'post_type' => ...
1
vote
3answers
145 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 = ...
1
vote
2answers
61 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 ...
-1
votes
1answer
213 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 ...
0
votes
2answers
1k views

Ways to give a wp_list_pages menu link specific class names?

I'm looking to style my wp_list_pages with a span class. I'd like to give it a unique class so that I can give each a specific icon. 'link_before' => '<span ...
0
votes
1answer
161 views

Adding elements to wp_list_pages (within <li>, but before <a>)

I'm working on my first wordpress theme and I'm running into some trouble. I'd like to add an extra div (which I'll style in css) within each <li>, but before the actual <a ... > element ...
0
votes
1answer
124 views

Include Custom Post Type Archive in wp_list_pages

I am wondering how to include a custom post type archive in wp_list_pages. If there were a page ID, I could simply attach that page to the list using the 'include' argument. I know that there is a ...
-1
votes
1answer
120 views

Making current_page_item work with wp_list_pages in sidebar on post pages

I'm working on a website where we have a menu in the sidebar that pulls the list of the parent for the current page, and all the children of that page. The problem is that, on pages where there's a ...
1
vote
1answer
52 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 ...
1
vote
1answer
197 views

new_excerpt_more link not working properly

My "Read More" button is linking to the current page page instead of the excerpt page it is suppose to be linking to. Here is my function in function.php file: function new_excerpt_more($more) { ...
0
votes
1answer
116 views

wp_list_pages hierarchical help

So I have been searching online for something that I think is simple to achieve and I am most likely over thinking it. I have found many related articles on the matter but can't seem to get it to ...
0
votes
1answer
73 views

List all pages including archive

I'm creating a custom options page on my site. One of the options is controlling a box on the homepage and i'm trying to set the link for the item to any page on the site via a select menu. as of now ...
0
votes
0answers
43 views

wp_list_pages isn't creating .children ul in one instance

I'm trying to build a menu on child pages that is structured like this Grandparent Parent Current Page child page child page Item 2 Item 3 Item 4 For one set of parent and child pages ...
0
votes
2answers
110 views

Get the ID of the direct parent page

I've seen plenty of tutorials on how to get the ID of the upper-most parent, but I can't seem to find anything on how to get the ID from the direct parent. Eg; - Big John - Little John - Baby ...
0
votes
1answer
93 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 ...
0
votes
1answer
54 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 ...
1
vote
0answers
29 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 ...
0
votes
1answer
326 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( ...
0
votes
2answers
1k 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 ...
0
votes
1answer
1k views

Need some help with “the_widget()” function

I am trying to create code to display certain default WordPress widgets on my e-commerce site. I have 6 content boxes which display WordPress widgets: • Pages • Latest Posts • Archive (last ...
0
votes
1answer
171 views

Wp_list_pages not showing children with custom page template

I seem to be having problems when using custom page templates using wp_list_pages. These pages are always displayed at the bottom of the website in a menu. The problem is, that they should have a ...