• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2669

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Tutorial Requests
  • Contact
  • Videos
  • Tags
  • Log in

Premium Member? - Request custom code

Add Custom Class To HTML Tag In Genesis

This code will add a class named custom-class, to the ul li tag ( Unordered List ) conditionally.

Here’s the default HTML before the custom class is added :

<li>

And here’s the HTML output once the code in this solution is installed :

<li class="custom-class">

You can use this code to add a custom class to any existing class conditionally.

Register or login to access the download folder :

Register for full access

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Brad Dalton Specializes In Genesis child theme customization & code modification. Read More…

Learn PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems