Skip to content

Instantly share code, notes, and snippets.

@BoyetDgte
Created February 26, 2020 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoyetDgte/9798a923f98dc35e29a30a7dc49561fb to your computer and use it in GitHub Desktop.
Save BoyetDgte/9798a923f98dc35e29a30a7dc49561fb to your computer and use it in GitHub Desktop.
Add a Class or ID in Wordpress specific menu <a> tag instead of the <li> tag using jQuery
// class name example
jQuery( "#menu-item-30142 a" ).ready( function( $ ){
$( "#menu-item-30142 a" ).addClass("class-name");
});
// #menu-item-30142 a is the element id with <a> tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment