Articles of menus

How can I make wp_nav_menu() support <br> tags?

Static webpage created nav menu separating titles using <br> tags, but when I’m converting the site into WordPress I’m missing <br> tags there. How can I enable using <br> tags in wp_nav_menu().

Nav menu from plugin to theme

I would to take nav menu reference (I have id and class) from plugin to theme header.php…How can I do this? I used something like this<?php wp_nav_menu(‘id’); ?> but of course with failure cause I didn’t specific from where I pick this menu…How can I do?

New walker for walker_nav_menu to change inside container data

I’m not really good with coding, but I have googled a lot and edit some script and it worked, but I can’t achieve what I need. This is the code: class description_walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth = 0, $args = Array(), $id = 0) { global $wp_query; $indent = ( $depth ) […]

How to undo the last changes to a custom menu?

I have a wordpress site with a custom menu. When I want to add a page or something to the menu, I click appearance, add the item, then drag it to the right location. This time when I did it the menu only saved about 30% of what was originally there. Normally, I would be […]

Change link in menu on condition

I have website, where I want to change link in menu, if I’m on this page, example: On frontpage link in menu is: On blog page link in menu is: Is it possible?

Adding Additional Variables on Menus Page

I’m learning PHP by building a plugin to show or hide menu items based on a user’s location. I am a bit stuck at the moment. In the function below, the text input is being saved to the database, but I’m having trouble saving the radio button data to the database. I want to the […]

Get css class of menu item in custom menu structure

So, I’ve created custom markup for a menu. The functionality of the menu is built like so… <?php $parent = array(); if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])){ $menu = wp_get_nav_menu_object($locations[$menu_name]); $menu_items = wp_get_nav_menu_items($menu->term_id); $parent_id = 0; foreach((array)$menu_items as $key => $menu_item){ if($menu_item->menu_item_parent == 0) { $parent_id = $menu_item->db_id; $title = $menu_item->title; $url = $menu_item->url; $target […]

How to get submenu dropdown with images?

I need to add submenus with images as in below snapshot. Main menu has About,Deposits, Loans,…etc. and I need to add Kakulu Savings account, Apeksha Savings account …etc under the Deposits Menu as sub dropdown menus with images.Can anyone explain how to do that? It’s better if explain it with examples. -cheers-

functions.php adding item to end of menu. I want to change position

I found a function in my template that is adding a register button to the end of my menu. I’m wondering if there is any way to make this function add the register button to the beginning of my menu items? add_filter(‘wp_nav_menu_items’, ‘vertoh_wp_nav_menu_items’, 10, 2); function vertoh_wp_nav_menu_items($items, $args) { $widget_ef_registration = get_option(‘widget_ef_registration’); if ($args->theme_location == […]

How to add columns to wordpress menu editor

Wondering if someone can point me in the right direction. Currently, I’m trying to figure out how to add columns and headings to sub menus. Naturally I want to create a basic megamenu where I can add titles with links inside elements. With list below the items. I’ve done a quick mockup on codepen of […]