Adding a Data Attribute to a Menu List Item via the Walker Class
Here is how to add a Data Attribute to a Menu List Item via the Walker Menu Class. Some of the markup of the WordPress menu is hard to filter or hook into, the Walker class allows for a full custom menu mark up. One request I find is to add a data attribute to the list item…
Read MoreAdding Classes and Attributes to HTML elements in Genesis
Attributes can be added into various HTML markup elements via filters in the Genesis Framework, these attributes can be adding in an ID or additional CSS Class, or amending the Microdata Schema including role, itemscope or itemtype attributes. The HTML markup elements/sections also known as ‘contexts‘ are originally declared as functions in the core Genesis Framework in:…
Read MoreAdding an attribute and value to a WordPress Menu Item
Recently I had to add a Bootstrap modal trigger from a WordPress Menu item, the modal trigger requires an attribute of data-toggle with a value of modal. There is no facility to add this to a Menu Item in a menu in WP Dashboard, however their are 2 solutions on how this can be done. Their is a…
Read More