If found out that this is removing my menu:
function add_menu_icon ( $items, $args ) {
if ( $args->theme_location == 'primary' ) {
$elements="<li class="custom-logo">"
. get_custom_logo() .
'</li>';
$elements .= $items;
$items = $elements;
return $items;
}
}
add_filter( 'wp_nav_menu_items', 'add_menu_icon', 10, 2 );
I still haven’t figured out why.
Related Posts:
- How to remove hardcoded characters from playlists?
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How can I add a class to a single menu item?
- Understanding WordPress child theme custom JS loading
- Use different javascript files for each page on website
- Trigger popup in a php if/else statement
- Multiple WordPress Menus that will only display all pages
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- Need Help Fixing My Iframes [closed]
- Menu jumping when calling it via PHP
- Redirect to another page using contact form 7? [closed]
- Show About and Contact Us page when they’re clicked in the top menu.
- How to modify mobile nav menu text in theme
- Output only links using wp_nav_menu()
- Get css class of menu item in custom menu structure
- How to add aria role and schema markup to custom walker container
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Why in this WordPress theme I can’t see the Main Menu?
- How to tell if a user has gone in and created a menu
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- Remove the Tag from wp_nav_menu
- security concerns if using html data-* attribute for l10n?
- How to extend SelectControl with data from my theme
- register dependency css and js inside a plugin class
- Collapsible menu on post sidebar only expands and does not collapse
- Bring Font Awesome icons inside menu A tags
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- if is_home(), change class of menu-item-225 of wp_nav_menu
- 404 error on page reload
- What is considered good practice for registering menu locations?
- WP Bootstrap NavWaker: Dropdown Menu Opens All Dropdown Menus at Once
- Javascript code inside “” in core WordPress files .php
- Site Health : An active PHP session was detected
- Create custom blocks for bootstrap
- Switching between custom templates in a post type of the admin menu
- Minify HTML, CSS, JS with PHPWee?
- Second Navigation inside header
- Run a Parallel PHP Application with WordPress
- Creating new menu item
- Click loads template via ajax
- Am I not understanding plugins?
- Archive dropdown styling not applied
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- Uncaught TypeError: Cannot read property ‘firstChild’ of null after upgrading to WordPress 5.5
- Using Font Awesome as post thumbnail
- Can I change a variable in a content part while calling it?
- Display notification only once
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Access/update database with jQuery
- Programmatically create menu with custom link
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Use WordPress’s Media Uploader/ Manager in non WordPress php application
- Get/Set wp.customize.previewer.previewUrl
- Custom Loop through category menu to include sub categories
- selected menu item
- javaScript in section of WP API
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- admin-ajax.php responding with 0
- Using wp_localize_script to store the template url into a variable to use in JS
- How to display recent posts on home page with custom HTML
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- How can the plugin directory path be returned into ?
- items_wrap not working
- Remove annoying WP Adminbar CSS
- How can I add tinymce editor in WordPress with jQuery?
- What is the fastest way to load PHP functions that are only used in one theme template?
- How to speed up admin-ajax.php in wordpress
- My Own layout in WooCommerce pages [closed]
- Style wp_page_menu() items
- JQuery not working on WordPress Admin page [closed]
- Customizer Show/Hide
- Page Reloads Before AJAX Request Finishes
- Differences when using the the_time and the_date functions
- Exclude posts from homepage having a specified tag
- Why is this Ajax not working?
- wp nav menu: add attributes to menu items [duplicate]
- How do I access the media settings
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- Changing the template hierarchy
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- How to make custom total price reactive in navigation
- Adding tawk.to code just before body tag on functions.php file
- using add_action for a header hook that has an additional parameter
- How do I fetch all comments per post via WP REST API?
- Have CSS Class Added with `is_page()` WP function
- Deregistering a script in WordPress seems impossible
- Slide in Panel WordPress Post
- custom shortcode will not display the wrapped content
- Sending jsPDF documents to the server
- How to prevent those PHP variables from being cached on WordPress?
- Ajax return code 400
- Can’t load WP function into external function
- How can I add an alert (like the old javascript alerts) to my WP page?
- Pass PHP variable to JavaScript without inline JS
- Custom category code not showing all posts
- Displaying theme options in css
- Show post in slider