Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress wp_list _pages

Featured Replies

Hi there. I'm using wp_list_pages to display the sub pages on my portfolio page here.

 

http://www.angelssin.co.uk/portfolio/

 

and when I click on the link it takes me to the sub page (the work in my portfolio that I clicked to go to) which for example would be here.

 

http://www.angelssin.co.uk/portfolio/wolves-anime-club/

 

The code I'm using for the main portfolio page is

<? wp_list_pages('title_li=&child_of='.$post->ID); ?>

but won't work on the sub page because it has no child pages. So basically I want it to list all of the second level pages and none of the parent pages. I looked into excluding pages but that didn't work.

 

Is there a way that I can display the current level pages and exclude the parent page at all?

 

Any help is as always much appreciated :)

If you only want to display specific menu items, just use the include parameter with the ID numbers of the pages.

 

If you want to display everything except certain pages, use the exclude parameter with the ID numbers of the pages.

It's something like this...

 

<? wp_list_pages('title_li=&depth=1&child_of='.$post->ID); ?>

 

The additional piece of code is depth which determines the level of heirarchy.

 

I think thats what your asking! If you want to display them unrelated to post ID do this...

 

<? wp_list_pages('title_li=&depth=1'); ?>

 

That will list all pages your blog has from the 2nd level as 0 is the first level which I assume you know.

 

Hope it helps

Ryan

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.