• I’m trying to understand how my WP theme works and I’ve encountered instances where special characters are used within the id= and class= attributes, and I’m trying to understand what they mean. Here is an example: ‘<li id=”%1$s” class=”widget-container %2$s”>’. When I look in style.css I cannot find any specific IDs or classes with the “%1$s” or “%2$s” characters, so I’m thinking this is some special CSS character sequence? What do these characters mean?

Viewing 2 replies - 1 through 2 (of 2 total)
  • These “special characters” are substitution codes. So WordPress replaces them with real id & classes (such as text1 etc) in the final generated page.

    Thread Starter gmatoka

    (@gmatoka)

    Is there any way that I can translate the substitution codes into the real classes and ids that they represent? I.e., how can I know what they mean so that I can locate them in the style.css file?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘What do special chars mean in ID and class attributes?’ is closed to new replies.