Articles of menus

Add child pages automatically to nav menu

I have built a custom menu in WordPress that contains links to posts and pages. I am adding it to my header using this line of code: <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘depth’ => 0, ‘menu_class’ => ‘nav-menu’, ) ); ?> My problem is, if I add a child page to the top level […]

Sort wp_nav_menu() by menu order

I have made a custom menu handler for the back end, sorting the via a drag drop based on CMS Page Order. The problem now is that it seems that it’s not possible to sort wp_nav_menu in any other way than the default one, can that be really be true?

removing <li> tags from wp_list_pages() using PHP

as the title states, I am trying to remove the <li></li> tags from the list that gets generated with wp_list_pages(). My thinking is to somehow run a for/foreach loop through the menu items and remove the <li></li> tags using str_replace(), but first I would need to parse the returned list into an array or something […]

Remove Metabox from Menus screen

Been digging into WP files for a bit and think I just might be missing something. The end-goal is to remove the Theme Locations metabox from the Menus screen if someone doesn’t have a certain capability manage_options. I know, a little odd for usability, but there’s only one menu and we’re trying to make this […]

Force PDF download from custom menu?

I added a link to a PDF in my custom navigation menu. Is there a way to force it to download instead of open?

Minor css-change based on topmenu – how?

I want to make minor css-changes based on the choice of the top (root) menu. What’s the proper way to handle this in WP? //edit// It’s a website (pages), no blog, and basically, the colors of some links and some images should depend of the choosen top-menu-item. Example, page-structure: * Start * Products * Prod.categ. […]

Adding Additional Menus In Genesis Child Themes

I have a Genesis child theme that I bought, and it only supports two menus, a primary and a secondary. However, for what I would like to do with my site I need to have 6 menus all together. This is my website This is what I want the menus to look like […]

Menu styling for last menu item

okay so I’m using the following code to get my links… <?php wp_nav_menu( array(‘theme_location’ => ‘primary’, ‘container’ => ”, ‘menu_class’ => ‘mainnav’) ); ?> This is my CSS for the nav… .mainnav a { font-family: gooddog_plainregular, Arial, sans-serif; font-size: 30px; color: #ffea00; text-decoration:none; } .mainnav li:after { content: url(‘images/nav-divider.png’); } .mainnav li.last:after { content: none; […]

How to change the admin menu “Pages” to something else

When one creates a custom post type you have the ability to define various elements related to that post type which essentially allow you to define things such as the menu title, “add new post” text and stuff like that. What I am trying to figure out is what code I need to add to […]

How to remove div container in custom menu?

all As per my html theme structure i do not want to add my menu <ul><li> under <div>. I am using <?php wp_nav_menu( array( ‘menu_class’ => ‘tlm’, ‘theme_location’ => ‘primary-menu’ ) ); ?> By default this wrap my menu with div. like <div class=”menu-first-container”><ul class=”tlm” id=”menu-first”><li class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-23″ id=”menu-item-23″><a href=”http://localhost/tmw_new/”>Dashboard</a></li> <li class=”hasul menu-item […]