Pretty permalinks creating 'active' trouble :
-
Hi!
Im using a simple if to determine if a tab should have the class active or not, just for looks. I had it working before i turned on pretty permalinks, but now it wont work properly.
<a href="?page_id=52" class="<?php if ( $page_id == "52" ) { echo "active"; } else { echo ""; } ?>"><span class="subborder"> <span class="subbutton"> Foto </span><!-- /subbutton --> </span></a><!-- /subborder -->Since it nolonger can recognize the page id, it doesn’t give it the active class since the if isn’t fullfilled. So is there a way of making it recognize a string, like “$page_id == foto”? Or some other way to get it to understand when that page is active? I works on categories, but not pages :< Thanks in advance!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Pretty permalinks creating 'active' trouble :’ is closed to new replies.