Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6992355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:37:24+00:00 2026-05-27T19:37:24+00:00

I need some help with wordpress. The idea is create multioptional navigation in sidebar.

  • 0

I need some help with wordpress.
The idea is create multioptional navigation in sidebar.
Hierarchy is looks like this:

<ul>
<li>First Page
    <ul>
    <li>First SubPage</li>
    <li>Second SubPage
        <ul>
        <li>First Sub-SubPage</li>
        <li>Second Sub-SubPage</li>
        <li>Third Sub-SubPage</li>
        </ul>
    </li>
    </ul>
</li>
<li>Second Page</li>
<li>Third Page
    <ul>
    <li>First SubPage</li>
    <li>Second SubPage
        <ul>
        <li>First Sub-SubPage</li>
        <li>Second Sub-SubPage</li>
        <li>Third Sub-SubPage</li>
        </ul>
    </li>
    </ul>
</li>
</ul>

But i need some features.
When i on First Page, i want see only subpages of this page, not all pages in menu.

How i can resolve this problem?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:37:25+00:00Added an answer on May 27, 2026 at 7:37 pm

    Make use of the function get_pages http://codex.wordpress.org/Function_Reference/get_pages

    You can use the following function. Call it in the sidebar with $page_id as <current page id>.

    <?php    
    function show_child_list($page_id) {
        $child_pages = get_pages( array( 'child_of' => $page_id, 'sort_column' => 'menu_order', 'sort_order' => 'ASC', 'parent' => $page_id) );
        echo '<ul>';
        foreach($child_pages as $child) {
            echo '<li>'.$child->post_title.'</li>';
            show_child_list($child->ID);
        }
        echo '</ul>';
    }
    

    Update 1:

    Added 'parent' => $page_id attribute in third line, so only first level child are returned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help with this error. Fresh wordpress 2.9 install... Fatal error: Cannot instantiate
I need some help about mod_rewrite, this is my wordpress address: http://localhost/my_v2010/restaurants?m=display_Add base_url: http://localhost/my_v2010/
I am doing this first time so I need some help. I am using
Need some help to solve this. I have a gridview and inside the gridview
Need some help with this problem in implementing with XSLT, I had already implemented
Need some help gathering thoughts on this issue. Our team is moving ahead with
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I learning how to write a WordPress plugin. I need some help writing some
This is the page, its a wordpress powered site: http://bit.ly/9oJXWV You select some value,
Need some help about with Memcache. I have created a class and want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.