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 8829027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:44:26+00:00 2026-06-14T07:44:26+00:00

basically I have a three-level menu in wordpress and I’ve got the following code

  • 0

basically I have a three-level menu in wordpress and I’ve got the following code in the front-end to call the third-level menu:

$children = get_pages(‘child_of=’.$include_page_ids[$i]);

    if (count($children) > 1) {

        $sub = "<ul>";

        foreach ($children as $child){

        $sub .= "<li><a href='#$child->post_title'>";

        $sub .= $child->post_title;

        $sub .= "</a></li>";

        }

        $sub .="</ul>";

        echo $sub;

    }

This calls a list for the children of a certain page and also makes the the anchors (which I also need). The problem is that right now they are being displayed in an alphabetical order, but I need to be able to set the right order myself (ie to be the same as in the backend menu). Please hepl me with it, how can I achieve this? For example this is the page http://www.eboxlab.net/transbeam/support/support/, youcan see the third level-menu as the box right next to the banner (Acceptable Use Policy to Terms & Conditions). THe order of the blocks which it corresponds to is right, but the menu is alphabetically ordered.
Help really appreciated.
PS: if you need I can provide the template code

  • 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-06-14T07:44:27+00:00Added an answer on June 14, 2026 at 7:44 am

    It’s pretty simple actually. Here is what your $children call should look like:
    $children = get_pages('child_of=' . $include_page_ids[$i] . '&orderby=menu_order&sort_order =ASC');

    That’s all you need to add – this tells the query to order pages in ascending fashion by their “menu_order” column(or the “Order” field under Page attributes). You can see more details on the get_pages function at Function Reference/get pages

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

Sidebar

Related Questions

I am trying to build a three level treeview in WPF. Basically, I have
In our product, we have frames that are basically three inheritance levels down from
I basically have three tables, posts, images and postimages (this simply contains the ids
Basically I have some class objects, each with three properties. Once one class object
I have this page which has three peson searchs on them. Basically it's a
I have a mysql table with three columns: username, location, timestamp. This is basically
Is there any name for the following DB table design: Basically we have generic
I would need some help with the following code if you are kind. Basically
Basicall I have three Tables Users Roles and USerRoles with Many to many Relationship.
Basically I have two 2D points and there is a line between them. A

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.