Articles of wp list pages

Keep page hierarchy in wp_list_pages, even if on a child or grandchild

I have the following structure of pages, and I need to have that same structure displayed on those pages who have child pages: – Childpage – – Grandchildpage – – Other Grandchildpage – Other Childpage The following code is used to display the structure on page.php: <ul class=”sidemenu-list”> <?php if($post->post_parent) $children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=1″); else $children […]

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 Entertainment Movies TV Podcasts … and I was on the Oranges page, it would display this: Food Vegetables Dairy Fruits Apples Bananas Kiwis > Oranges Sports Entertainment I’m attempting to use wp_list_pages() and its child_of […]

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 codex says: ‘depth’ (int) Number of levels in the hierarchy of pages to include in the generated […]

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?

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 wondering if there’s a way to use list_pages (because of the formatting) to also show the ids? Alternately, how do I […]

active parent page when clicked on childpage

Hi there WordPress guru’s, i running up against a problem. I’ve my parent pages in the header.php and childpages in page.php. when i clicked on one of the subpages in a parent page i want that my parent page stay active. How can i get that done? in my header.php i’ve the following code: <ul […]

Load parent pages when there are no child pages

I use the following code to load subpages in a sidebar on all pages: <?php $children = wp_list_pages(‘title_li=&child_of=’.$post->ID.’&echo=0&depth=1′); if ($children) { ?> <ul id=”three-menu”> <?php echo $children; ?> </ul> <?php } ?> It works well on all pages with sub pages or children. But what if I want this sidebar with children pages to load […]

Exlude pages from wp_list_pages

in a blow I’m working on there is a navigation menu made of pages and subpages. I didn’t code it, so I’m not completely sure how it works, but after reading some code it seems that the menu is generated by this line in the navivation.php file. <?php wp_list_pages(‘title_li=&depth=’.$bpt_navigation_depth.’&sort_column=menu_order’); ?> Now, I had to manually […]

wp_list_pages() refuses to output posts

Someone help me understand why the following do not output anything: wp_list_pages( ‘post_type=post’ ) wp_list_pages( ‘post_type=event’ ) Yet the following work as expected: wp_list_pages( ‘post_type=page’ ) WP_Query( ‘post_type=post’ ) WP_Query( ‘post_type=event’ ) I’m stumped.

Exclude pages by menu order

i have a “Default Page Generator” on theme activation i have created… in that file i set ‘menu_order’ for each page. i want to exclude pages with menu order bigger then 50 from the default wp_list_pages menu Is there a way to check for / retrieve ‘menu_order’ of each page? and if there is can […]