Articles of wp list pages

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 “actors”. I would like to create a page called “actors” that could loop all actors pages with pagination, organizing them […]

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 problem being that if I add the argument to each set of parentheses, I end up with two […]

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 but I’m confused on how to keep them displayed on the grandchildren pages. How can I do this? <?php […]

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 change – I don’t want the top level ancestor displayed if it has no children! It doesn’t […]

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 are on a page and that the page is a parent. $kiddies = wp_list_pages( ‘sort_column=menu_order&title_li=&child_of=’ . $post->post_parent . ‘&echo=0’ ); […]

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”></li>. I would like for it to output <li class=”hvr-underline”></li>. Here is the code I have so far: $children = wp_list_pages( ‘title_li=&child_of=’.$post->ID.’&echo=0′ ); […]

wp_list_pages: only show subpages on the parent page?

I’m using wp_list_pages(‘title_li=’) on my site. Some of my pages do have subpages, however I don’t want to list them unitl I’m on an actual parent page that has subpages. So imagine my front-page: — About Us — Gallery — Kitchen — Disclaimer When clicking on Gallery (and Gallery has two subpages) I want them to be listed […]

wp_list_pages – Using a Walker to customize output order

I’m using wp_list_pages to create a navigation menu. I’ve run into a challenge with the menu order, though, and I am trying to figure out a way to take more control over the order of the menu. Is it possible to customize the order of the wp_list_pages output using a Walker? For example, I’d like […]

Change ul class=“children” for wp_list_pages?

Hello I’m using this code to print a list of Pages and Subpages: <ul> <?php wp_list_pages(‘title_li=&depth=2&child_of=’); ?> </ul> It outputs: <ul> <li><a href=”#”>Page 1</a></li> <li><a href=”#”>Page 2</a> <ul class=”children”> <li><a href=”#”>Subpage 2a</a></li> <li><a href=”#”>Subpage 2b</a></li> </ul> </li> <li><a href=”#”>Page 3</a></li> <ul class=”children”> <li><a href=”#”>Subpage 3a</a></li> <li><a href=”#”>Subpage 3b</a></li> </ul> <li><a href=”#”>Page 4</a></li> </ul> Is there […]

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 = wp_list_pages(‘title_li=&depth=1&child_of=’.$post->ID.’&echo=0′); if ($children) { ?> <h2> <?php echo $children; ?> <?php the_excerpt(); ?> </h2> <?php } ?>