I have the following code in my template which adds the class of ‘current’ to the current page:
{if {category_id} == '<?php echo $cat_id ?>'}
<li class="current"><a href="/{segment_1}/?cat_id={category_id}">{category_name}</a></li>
{if:else}
<li><a href="/{segment_1}/?cat_id={category_id}">{category_name}</a></li>
{/if}Im maintaining this site but I didn’t build it. Ive modified the site and I need to use this code in a few different places, so ive put it in a template embed. The links still work but the ‘current’ class is never added. Thanks