Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to create a dynamic WordPress menu using wp_nav_menu() divided over four lines or rows as the static website. I think I should either force the menu to do this using CSS and width limitations or PHP. I do think PHP is needed as certain menu items will be followed by images before the menu continues again - see site.

Is it possible to use a dynamic WordPress menu for this situation or should I just go for dynamic sidebars or static blocks?

If it is possible to use WordPress dynamic menus how would I do this given the fact that the menu should be on four lines and is interrupted by images every now and then?

Update:

Perhaps I should just use three menus to solve the splitting of the menu into three pieces, but then I still have the issue with the images in between.

Update 2:

Decided to go with a few sidebars with several widgets inside. For each menu item I will use a text widget. So basically I am doing what @Webord recommended

share|improve this question
    
How about a Mega Menu plugin? –  Brad Dalton Jan 8 at 5:52
add comment

1 Answer

up vote 1 down vote accepted

So, In your place I would go for Dynamic Sidebars because of the control over Widgets is much more easily achieved. But if you still want use WordPress Navigation Menus to do it, to control the output the way you want you need to extend the Class Walker_Nav_Menu, take a look at a usage for the Walker extended.

But I would highly recommend you to go with the Widgets, the API have much more options.

share|improve this answer
    
Thanks for your input. Was reading on the walker class and how they use it to for example add a description to a menu. But yeah, I am leaning towards widgets. It is just that I would need 10-12 widgets for the homepage alone. All these widgets will be added one below each other in appearance widgets. Unless I go for three sidebars.., but still a lot of widgets to maintain. And as all menu boxes need custom colors.. –  rhand Feb 25 '12 at 5:23
    
No need for 12 widgets, just make something customizable, with predefined colors and some options for the user. And you dont need 3 Dynamic Sidebars, just one, and then split based on the side of the boxes using a little bit of css and PHP logic. Checking for bigger widgets or something like that. –  Webord Feb 25 '12 at 6:06
    
By custom code you mean creating custom widgets like justintadlock.com/archives/2009/05/26/… ? Would probably be convenient to create a widget with several text fields, one for each menu item. But it would require me to learn something new while I am already behind schedule. Did reduce sidebars already and added some floats and it is looking better. Looking into custom widgets to see if this can be done quickly and will improve maintenance. If not I will stick to what I have now: three sidebars and many widgets. –  rhand Feb 25 '12 at 6:46
    
If you come up with a good solution update your Question with the code, so others can see. –  Webord Feb 25 '12 at 7:04
    
Not creating a widget by a sidebar widget area in or under the menu area. –  Brad Dalton Jan 8 at 5:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.