Articles of menus

How do I create a root link in wordpress to a PDF file?

I want to upload my resume to media (which I have done) but link it directly to joeblow.com/resume I want that link to display the PDF ideally or if not possible to redirect to a URL (the resume is in wp-content/uploads/…) Thanks,

Show thumbnail to category items in wp_nav_menu(), how?

Im trying to figure out how to show category thumbnails in the menu items from wp_nav_menu(). My idea is to add a thumbnail data attribute with the filter ‘wp_nav_menu_objects’ in wp_nav_menu(). I will add this code: $sorted_menu_items[$key]->thumbnail = woocommerce_subcategory_thumbnail($item); The problem is how to then add it to the HTML. Im first trying to find […]

Enable identical menu on network sites

I want a network of sites in a multisite install to automatically have certain items in the main menu when the user first uses the site. This seems surprisingly hard to do, and the new REST API doesn’t provide ways to interact with menus. So instead I’ve created a simple plugin, which creates a menu […]

Menu not showing all items

Title says it all. It’s been days now and I can’t figure out what the issue is. There are about 80 – 100 menu items maybe more. Plugins used; Max Mega Menu Category Posts in Custom Menu The site has custom post types built as a plugin which just registers the custom post types and […]

Nav menu category links not showing

I am new to wordpress and have a project where I have show nav menu category links like this: <?php wp_nav_menu(array(‘theme_location’ => ‘primary’, ‘menu_class’ => ‘menu right’)); After adding a new category in the admin, the new category link is not showing in the menu. What should I do about that?

problem with wp-menu nav walker

I have created the boostrap menu with Walker. code below. But for some reason the dropdown does not work. caret is shown but no action done. menu items addedin the admin as they should be. <div class=”collapse navbar-collapse ” id=”navbar-collapse-top”> <!– /—–main menu—-/ –> <?php wp_nav_menu( array( ‘menu’ => ‘main’, ‘theme_location’ => ‘primary’, ‘depth’ => […]

Add code to WordPress menu items by class

I am trying to add onclick=”toggle_visibility(‘sub-menu’);” into the opening tag of specific menu items generated in WordPress. I have used the following function to target all parent menu items and now need to find the correct js to add this in dynamically. function menu_set_dropdown( $sorted_menu_items, $args ) { $last_top = 0; foreach ( $sorted_menu_items as […]

navbar walker logout in dropdown

I need to add the logout button-link to drop-down submenu (i use wp_bootstrap_navwalker). Parent item is link to User-info page and i need to add Log-out link/button in dropdown. I do not have Log-out page that could be added in menu dashbord, so i have to create function or active link. Could be this done […]

Add Featured Image and Title to wp_nav_menu items

I like this solution from Ahmad M, a lot, but how do I add images in addition to titles, instead of replacing titles? (Sorry, I’m still pretty new to PHP and Stackexchange). Pulling Featured Images in to a WordPress Menu I mostly figured it out. I’m using Ahmad M’s filter but needed to add “.$menu_object->title” […]

Create sub menu 3 level with walker class

I’ve used the menu walker below to display dynamic submenus with great effect in the past. It displays 2nd or lower-level menu items if the current page is a parent, sibling, or descendant of the page. For example, if the menu hierarchy is: A B 1 i ii It will show, 1, i, and ii […]