change this line:
$item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
to:
$item_output .= $args->link_before . apply_filters('the_title', substr($item->title, 0, 10), $item->ID) . $args->link_after;
That limits the character to 10. Please note this substr($item->title, 0, 10)
.
Related Posts:
- Adding first / last CSS classes to menus
- Mega Menu Walker
- start_lvl Ignored in Custom walker_nav_menu
- Walker class: Problems with understanding how walk() method can be called without error
- wp nav menu: add attributes to menu items [duplicate]
- Run a filter when a walker runs
- Can’t extend some core classes
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- WP Walker using custom css classes
- Automatically adding new post categories to menu
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- Trying to store submenu items to render out after main menu
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- New walker for walker_nav_menu to change inside container data
- Add login hyperlink to secondary navigation menu
- Menu Custom Data Attributes
- How to display different submenus?
- How to modify mobile nav menu text in theme
- conditional: if is page, and all subpages
- wp nav menu: show submenu below li item
- Styling an “active” link outside of WordPress default menu
- Nav Walker that shows only children and siblings of top level parent menu item
- how to changes mobile menu toggle breakpoint in WordPress
- Create Columns with Custom Walker and CSS Classes
- Adding markup to sub menu based on class
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- How to let mobile navigation menu close when link is clicked?
- Bring Font Awesome icons inside menu A tags
- Difference between “Walker_Nav_menu” and “walker”
- Add parent menu item in sub-menu in custom nav_walker
- Display specific main Sub Nav on Woocommerce product pages
- How limit the width of a fixed menu-bar on scroll?
- Add the “.current-menu-item” class to tag?
- WP_Nav Highlight Parent Issue
- How to change the menu color
- Custom Links in Walker Class
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- renaming an admin menu item with decimal array index number
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- “wp_enqueue_style();” don’t load new edited style
- wp_delete_auto_drafts() deletes links in menus
- Replacing the NavWalker dropdown element
- How to add specific menu on a specific page or pages
- WordPress menu deletes when trying to add a hook
- Archive dropdown styling not applied
- Custom Loop through category menu to include sub categories
- selected menu item
- Different background-image by category
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Show comments menu in dashboard only if the site has comment
- Count top level menu items
- Slider loading issue
- Css loads very slow [closed]
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- CSS_Menu_Walker not showing on mobile view?
- Which is the correct way to conditionally enqueue a CSS file?
- Add item to top of menu using a filter in functions.php
- Automatically add images to a menu
- Where can I find the inline-css of my theme header?
- Website completely messes up when logging out
- How can I use custom menus with a Bootstrap WordPress theme?
- Adding Additional Variables on Menus Page
- Applying CSS on PHP variable [closed]
- Class for Selected Menu using wp_nav_menu
- Timber right sidebar in WordPress theme
- How to Remove Theme Style CSS inside Custom Plugin?
- Featured image in menu wordpres
- Add other class content with reference class value
- Adding Custom css file in the wp-uploads directory with custom php functions
- How do I integrate vanilla Javascript to a wordpress website?
- Cannot dequeue Elementor Font Awesome css
- How to find and delete a menu item in php?
- WordPress Slider is not working
- How to display post meta bellow every posts
- Add Shortcode to ::before class
- PHP warning with code for nav menu walker [duplicate]
- String replace for Login/Logout concatenation problem in menu
- Displaying POST content with HTML tags and all
- Custom Thumbnails [closed]
- wp_nav_menu prints children with parent name
- WP Admin Bar – Get current theme name as custom menu title
- wp add inline style in loop
- Display pages from specific page template
- How do I use CSS or PHP to customize WordPress Form Manager Plugin Table?
- Submenu opened problem
- Sidebar doesnt get updated?
- How to NOT override inline css rules
- Load files content [closed]
- Predefine Magazine Style Layouts
- It’s not showing full content for posts pages in wordpress “[…]” while customing some changes in the style.css file [closed]
- Add a “Next Post” & “Previous Post” styled button manually to a post
- Sorting Problem
- inner-wrap div pushing custom table far down on page
- Custom nav with bootstrap dropdown