Adding category link in Blix’s top navigation
-
Hey all!
I’m using Blix in one page I’m building.
If you’re not familiar with this template, it uses (for example):<li<?php if (is_home()) echo " class="selected""; ?>><a href="<?php bloginfo('url'); ?>">Bloco</a></li>
…to display a top navigation link called ‘Home’ and it uses the class ‘selected’ if you’re in the home page. Something like that, hope you get the idea.
What I’m trying to do is doing the same with categories, but I’ve failed…
I’m using the following code:
<li<?php if ( in_category('2') ) echo " class="selected""; ?>><a href="https://www.example.com/category/forum/">fórum</a></li>
Any suggestions?
Thanks in advance ??edit:
I’ve tried this too:<?php if ( in_category('2') ) : ?>
<li class="selected"><a href="https://www.example.com/category/forum/">fórum</a></li>
<?php else : ?>
<li><a href="https://www.example.com/category/forum/">fórum</a></li>
<?php endif; ?>No luck.
- The topic ‘Adding category link in Blix’s top navigation’ is closed to new replies.