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?
- How to style options page in dashboard?
- Change list item content in menu navigation to add a child element with specific class
- Theme Options Page – User Updates Logo
- How to use my style.css file outside of wordpress subdomain?
- Dynamic Stylesheet loads but doesn’t finish
- How to add date to navigation bar
- Menu Limitations
- How can I Add a variable PHP in the Menu Nav
- Selectbox in admin panel function linking to CSS
- Where to place PHP code that inserts (or doesn’t insert) menu item?
- Can I install/embed WordPress on a ‘single page’?
- Using if/else statements with output from theme options
- Is there CSS to expand the gallery limit on Index Pages?
- Adding an Avatar to the Top Nav Bar
- Add data attribute to each li in menu
- How to design a table based on css values set from admin/dashboard
- Remove metabox from WordPress menu editor page?
- How to add an arrow to menu items has submenus
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- Incorrect MIME type for assets with Valet
- How to display pictures from database?
- How to add condition in wordpress loop? [closed]
- Unique icons next to each WordPress menu item
- Child page menu in sidebar
- Title Case WordPress Menu Items
- Customize position of social icons in upme plugin [closed]
- Delete mobile menu button [closed]
- Best way to schedule daily change in CSS parameter
- Css loads very slow [closed]
- Gravity form built in Captcha
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- How does wp_enqueue_scripts work?
- Different post styles depending on category
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- CSS_Menu_Walker not showing on mobile view?
- How to change menu order item
- two columns of posts on homepage, one of them “favorites”
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- custom css for admin only
- Custom Menus: dynamic highlighting problem with custom home link
- responsive.css in the WordPress should be prioritized
- How do I add a custom css to all posts without affecting homepage css? [closed]
- get_the_title() gets printed out twice
- Redirect to another page using contact form 7? [closed]
- Which is the correct way to conditionally enqueue a CSS file?
- Custom Background by Page IDs
- proper way to add css using functions.php?
- WordPress style.css not updating, only after theme reload
- Adding logo to WordPress header
- Thumbnails appear to be zoomed
- Use PHP in stylesheet to specify a background image based on Category ID
- Add item to top of menu using a filter in functions.php
- Automatically set all tags to have a height of 0 if there is no content inside the tag [closed]
- height should be set to auto to avoid pixelation in the post thumbnail function
- Odd / Even posts add class minus first post
- Change CSS based on is_user_logged_in
- Adding PHP in the menu