Articles of menus

Page-Linking Structure

I’m trying to create a custom WordPress theme from scratch. As you can see, my file structure looks like this – footer.php, header.php, index.php, about.php, and contact.php within my theme folder: I’ve completed the home page (index.php) and now I’m trying to create these other pages and link to them. But when I go to […]

Editing or filtering the output of the Genesis navigation

I’m trying to edit or apply a filter to the default Genesis navigation genesis_do_nav Currently I’m extending a Walker class to add a <span> with data-attribute around the navigation’s link text. class Menu_With_Data_Attr extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( “\t”, $depth ) : […]

How to quickly create a dummy menu?

I want to create a dummy menu with 1 or 2 level of depth. I know I can create the menu via the administration module, but I want to know if there is something I can use to generate fast a dummy menu. I have a file with the sitemap indented by spaces that look […]

Include Max mega menu Plugin into theme

I want to add the Max Mega Menu plugin into my theme for a project. What i’ve done: copy and paste plugin folder into my theme include megamenu.php file into my theme function.php file Needed to work: include with theme active when theme active So, how can I include this plugin and activate it when […]

Recreating the hierarchy of taxonomies for a dropdown form menu?

I have a form that contains a dropdown menu. This form is on a page form.php and is not part of my theme. It exists outside of my site. This dropdown menu contains my list of values for a custom taxonomy called Formats. My Formats are as follows: Entry Form Facebook – Entry Form – […]

wp_nav_menu (secondary menu) not adding current classes

I’ve looked everywhere, but i can’t find a solution. My secondary menu isn’t adding any current classes to the tags when it’s rendered. I have added this menu in my functions.php file function register_menus() { register_nav_menus( array( ‘second-menu’ => __( ‘Second Menu’ ) ) ); } Then I created a menu in wordpress with the […]

How to limit wordpress menu depth in admin panel

Is it possible to limit maximum menu depth in admin panel /nav-menus.php? I need this because my theme won’t support more than two levels of menu, so there is no point in allowing a user to make deeper menus.

Multiple menu items highlighted

I am using WordPress as the CMS for my website. For my navigation menu, I am using WordPress’ inbuilt navigation menu function. You add categories, page, etc, to this and it generates a list with certain classes you can style – like current-menu-item. My problem lies here: I have several categories in my menu, and […]

How to target children of child pages

I would like to apply special styling to the menu items of pages that are children of child pages. Is there a way to do this?

What is the difference between current_page_parent and current_page_ancestor?

In the function wp_page_menu there is an auto-generated classes to the list elements and the function generates current_page_parent and current_page_ancestor to a parent menu item if I clicked a child menu item (I mean if the current page is the child menu element). So now why does WordPress generate two different classes for the same […]