Tutorial by Warren Woodhouse
- Backup your Theme beforehand
- Open Theme Editor
- Jump to Blog1 widget
- Find the code below
<b:includable id='post' var='post'>
5. Add the codes below the line at Step 4 (shown above)
<b:loop values='data:post.labels' var='label'>
<b:class expr:name='" label-yourlabelname" + data:label.name' />
</b:loop>
The above code adds a unique class name with a reference .label-yourlabelname for you to custom set with styles in the CSS
It works best with single words and phrases but not long phrases
.label-yourlabelname {
background-color: red;
color: white;
}
9. Now add the next line to a new widget in the Layout section
<b:'class cond='data:view.search.label == "yourlabelname" name=' label-yourlabelname' />