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
- PHP unit testing WordPress?
- List of all theme customizer control types?
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- renaming an admin menu item with decimal array index number
- How to use WordPress (PHP) functions in AngularJS partials files?
- How to create a custom config file and get data using inline JS in a wordpress page
- Replacing the NavWalker dropdown element
- Widgets not showing in my custom theme
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- Use WordPress’s Media Uploader/ Manager in non WordPress php application
- Get/Set wp.customize.previewer.previewUrl
- What is the fastest way to load PHP functions that are only used in one theme template?
- How do I access the media settings
- Can’t load WP function into external function
- How can I output a php value into a JS file within WordPress?
- How to test nonce with AJAX – Plugin development
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Count top level menu items
- Slider loading issue
- How can i upload images in an admin page?
- Wp-login appears White Screen, Error: Cannot modify header information
- search and replace preword from author
- How to complete two other input fields, completed the first
- Open post-content in archive page in a Modal box with bootstrap
- Creating own shortcode – echoeing php variable based on JS variable
- How to add a do_action on refreshing of WP customizer?
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Add / Update Custom Fields After Select Pictures in Media Window
- How do I link a button I created in theme customizer to a function?
- can i fetch a custom metabox data in another page or post type?
- Add item to top of menu using a filter in functions.php
- ‘Post-thumbnails’ feature does not seem to register
- Tell WP register script to load a script only when the entire page is loaded
- Search form does not work in my website
- get_template_directory adding FTP root folders in urls
- Automatically add images to a menu
- trying to put an active hover to my custom nav category buttons [closed]
- How do I get my Javascript scripts working?
- Cannot access $wpdb, comes back NULL
- get db values for external js file
- Adding Additional Variables on Menus Page
- Ajaxurl suddenly not defined
- Toolbar Hidden in a Virtual Page
- Class for Selected Menu using wp_nav_menu
- Remove Custom Post Category In WordPress Slug Using .Htaccess
- Creating a brand attribute as a variable
- Add other class content with reference class value
- How do I integrate vanilla Javascript to a wordpress website?
- Looping through dummy posts and showing them in the main index.php
- WordPress Slider is not working
- Warning: count(): syntax problem of the count () function
- String replace for Login/Logout concatenation problem in menu
- Filtering markers on google map by WordPress category[SOLVED]
- Call jQuery function from PHP?
- Customizer: How to Sanitize a Decimal Number Range
- PHP code printed into CSS classes
- What syntax is this? “{{post.price}}”
- scroll scrpit to particular button position to next id when click button
- wp_nav_menu prints children with parent name
- WP Admin Bar – Get current theme name as custom menu title
- Why this plugin is not working?
- Submenu opened problem
- Sidebar doesnt get updated?
- Facebook share button only share the_permalink(), without thumbnail, tilte, excerpt, etc
- get_option(‘admin_email’) not working in wordpress when using ajax call
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Twig+WordPress how to use array arguments inside a function?
- How to store the_post_thumbnail() value in a variable
- Variable ++ in query loop
- How can I use AJAX in child theme template?