[NSFW] Assign specific class to post title, based on the category it's in?
-
Hi,
Okey, I need some help that is pretty simple. On my blog i make some posts that are NSFW. I want those posts to have a different title colour in the main post feed on the blogs homepage. I can do the css myself however, I need help with the php code to assign a specific class to a post title that has a specific category. How do I do this?
here is the code right now
if ( is_single() ) : the_title( '<h1 class="entry-title" )>', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif;
how do i add the class to title based on the category?
Please help!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[NSFW] Assign specific class to post title, based on the category it's in?’ is closed to new replies.