I’m having a problem with why this code is not working.
<li><?php if( get_the_archive_title() == "1 Bedroom House Plan") { echo 'class="active-tag"'; } ?><a href="#">1</a></li>
All I want is if the archive page title is equal to the string on the right to echo the CSS class of "active-tag", I’m using WordPress here!
Thanks again 🙂
3
Answers
Few changes and it worked,
<li><a <?php if( single_cat_title( '', false ) == "1 Bedroom House Plan") { echo 'class="active-tag"'; } ?> href="#">1</a></li>
Cheers all :)
Try to add like below:
you just misplaced your php code :
to