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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:20:13+00:00 2026-06-02T20:20:13+00:00

I have a dynamic two level UL LI drop down menu in wp. Actually,

  • 0

I have a dynamic two level UL LI drop down menu in wp. Actually, its currently a two column menu and rows are coming as required by child li elements. On some of the LI, child elements have lot of items, and I want to control it somehow to have only 5 row, if more than 5 rows then I want it to have more columns as required to accomodate all the items in menu.

Currently its a floated li elements with fixed width in a fixed width UL that supports two column.

So, I want it to have 2/3/4 or 5 columns as required but rows should be 5 always.

Its a dynamic menu and I don’t have any idea, how to do it.

  • 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-02T20:20:20+00:00Added an answer on June 2, 2026 at 8:20 pm

    One solution is to use the php array_chunk function to split the child items into groups of 5, then render each group in a different column as a separate list.

    <?php
    $items = array(1,2,3,4,5,56,6,63,7,8,9,876,5,4,436,23,57,575,4734,62);
    $chunks = array_chunk($items, 5);       
    foreach($chunks as $chunk) {
      $col = "<ul>";
      foreach($chunk as $value) {
        $col .= '<li>'.$value.'</li>';  
      }
      $col .= "</ul>";
      echo $col;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a two-level menu like the Dynamic Drive examples on this
I have two dynamic views in ClearCase which, as far as I know, are
I have a project whose artifacts are two dynamic libraries, let's say libX.dylib and
Situation: I have two fixed-height divs, overflow set to hidden on both, and dynamic
I have two dynamic tables (tabx and taby) which are created and maintained through
I have dynamic query I want to get two output parameters from it I
I have a form in Axapta/Dynamics Ax (EmplTable) which has two data sources (EmplTable
I have dynamic web page with JS. There is a <textarea> and a Send
I have dynamic array filled with bytes, which are read from .raw file with
I have dynamic content in a div called txtresults like this: <div id=txtresults></div> This

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.