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 am using a theme that is adding menu items and ignores the Wordpress menu editor. The way it adds menu's is like this:

It adds all pages to the menu, and in the order you add the page - So if you want the first menu item to be last, you have to delete its page, and add it again - then it will appear as the last menu item.

How can I prevent this from happening and have control over my menu items?

relevant code - all places where the containing 'ul.dropdown' hosting the menu items appear:


// Add ID and CLASS attributes to the first <ul> occurence in wp_page_menu
function add_menuclass($ulclass) {
return preg_replace('/<ul>/', '<ul class="reset dropdown">', $ulclass, 1);


dropdown.php - the whole file

<?php wp_nav_menu(array( 'theme_location'  => 'primary', 'sort_column' => 'menu_order', 'menu_class' => 'nav-menu', 'container_class' => 'nav-menu',) ); ?>

<div class="clear"></div>
share|improve this question
what theme? the menu is possibly using wp_page_menu() as fallback if the custom menu is not used. there might be more code to check, maybe in functions.php ? –  Michael Apr 3 '13 at 11:40
theme name is Carbon. see my updated answer for code relevant to wp_page_menu() –  David Van Staden Apr 3 '13 at 11:51
Please, don't Multi-post. Your Question already received answers in SO. –  brasofilo Apr 3 '13 at 12:05
I found the problem: I never specified a 'Primary Navigation' inside my menu editor –  David Van Staden Apr 3 '13 at 12:54

Your Answer


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

Browse other questions tagged or ask your own question.