This is tested, this will take all your sub nav and add the class.
$('#nav li > ul').parent().children("a").addClass("sub-nav");
Related Posts:
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Add custom menu item using wp_nav_menu_items filter
- Assign a Class to the Current “Tag” for Formatting
- Adding different classes to anchor in navigation menu
- Handling URLs in WordPress application
- Custom CSS class or ID on menu items that have a Submenu
- How can I make this custom menu work?
- Dynamic sidebar nav with current page highlighting
- Style internal links based on the tags of the linked post
- Removing Title From Links to Site
- Switch from hover to click on Twenty Twelve Menu
- How to add a custom CSS class to ALL links
- how to hide submenus for the not active pages
- How to buid wordpress menu with auto width sub-menu items in dropdown menu without any items sharing one line [closed]
- After moving my site, sub-menus are not showing [closed]
- Cannot change hover color for links [closed]
- URL links consistent with menus?
- Controlling sub-menu within sub-menu
- Creating a second menu on Twenty Eleven aligned right from the first
- Is there any way to change the CSS class applied to 2nd level sub menu ul’s?
- Superfish and WordPress: Active Color Problem
- Horizontal drop down category with hover effect working
- Change hover to onclick on menu
- How to change hover link colour for blog post (body) text only
- Problems styling a Custom Link in a Menu
- wp_nav_menu container style args
- WordPress menu issue after update
- Display specific main Sub Nav on Woocommerce product pages
- Adding span to a particular text in an menu item
- How can I add this specific link hover effect to a WP site? [closed]
- Always show wordpress submenu on responsive header menu
- WordPress Custom Superfish CSS Problem [closed]
- How to centre menu items on horizontal nav bar? (e.g. make margins equal) [closed]
- how to add permalink/slug to wordpress custom link menu item
- Main Menu Hover is Always White
- CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page
- What is the difference between the selectors “.class.class” and “.class .class”?
- Is background-color:none valid CSS?
- Text not wrapping inside a div element
- How to make padding:auto work in CSS?
- How to vertically center inside the parent element with CSS?
- Pure CSS to make font-size responsive based on dynamic amount of characters
- How to enqueue style before style.css
- wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i’m confused
- How to apply a class to the second word in menu list item?
- Which Details Are Required For Style.css File Header?
- Generate a Menu that displays all child pages of top level parent
- wp_enqueue_script + how to load JS or CSS in one URL merge call?
- Pending Custom Link in Menu
- hSite has no css on mobile [closed]
- How to set different font family based on text language?
- Relative path in wp_register_style not working
- How to add wechat (weixin) link to navigation menu?
- Link that refers to a menu item with dynamically generated URL
- How to Add Custom CSS Buttons to WordPress as a Shortcode?
- How do you customize the admin bar for buddypress?
- Load in wp admin assets from child theme
- Enqueue styles in new site editor in WordPress 5.9
- Code working just in specific time period
- Style WP_Debug?
- Is it safe to use WordPress generated classes?
- Search Bar in Thesis WordPress Site
- Add core style in theme
- How to sync the style in the visual editor with the style of a child theme?
- Add Custom Alignment Option to WordPress Blocks/Gutenberg
- Default Nav Highlight
- Custom css author role
- Remove submenu item from list
- conditional: if is page, and all subpages
- Embed widget from external source (Zendesk)
- Save custom option in CSS file
- broken internal JavaScript and CSS files
- avada woocommerce product details in grid
- How to display image on WordPress homepage
- Trying to hide the contact form on a particular page
- Default Gutenberg CSS on frontend
- How can I click the parent menu then redirect to a special URL?
- Stuck while adding bootstrap navwalker class
- Two CSS files loading extremely slow
- How to adjust text’s width and put it at center of post (Visual) editor?
- different theme output for desktop and mobile
- Font size decreases when child theme is created from parent theme?
- Enqueue CSS and Script only if needeed
- Bootstrap News: Image Modifciation
- resize chat bar on mobile [closed]
- Displaying a part of a menu containing the page the user is currently viewing and only it’s immediate children
- Improving the readibility of bright text on a bright background [closed]
- Trying to remove white space between nav bar and content?
- Colouring the text on the video
- Padding added in sidebar, not coming from my style sheet [closed]
- ID of parent Menu
- How to change wordpress registration form submit button value?
- Move main menu to top of screen
- Can’t override CSS with child theme
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- Enqueue MCE Editor CSS in admin page
- WordPress update leads to 404 error on admin page and signup. CSS mishap with all plugin related functions
- How to avoid problems caused by new block-library default CSS rules (wp 6.1.1)
- Grid problem on privew mode
- Disabling double vertical scrollbar and horizontal scrolling?