wordpress - How to add "name" attribute to a links in sidebar -
i need add "name" attribute links in sidebar. example;
before
<li id="menu-item-573" class="gallery-menu-top menu-item menu-item-type-custom menu-item-object-custom menu-item-573"><a href="#">weddings</a></li> after
<li id="menu-item-573" class="gallery-menu-top menu-item menu-item-type-custom menu-item-object-custom menu-item-573"><a name="weddings" href="#">weddings</a></li> name="weddings"
if can add class side menu ul "sidebar"; , value of name attribute going match content of link should work:
$('.sidebar a').each(function(i, item){ var value = item.textcontent; $(item).attr('name', value ); }); here's working example = http://jsfiddle.net/4snv4/ -
edit sorry noticed word press question: dont have ability above.
Comments
Post a Comment