# Add "active" class to current link

**URL:** <https://forum.getkirby.com/t/add-active-class-to-current-link/847>\
**Category:** Questions\
**Tags:** v2\
**Created:** [April 19, 2015, 8:29pm UTC](https://forum.getkirby.com/t/add-active-class-to-current-link/847 "2015-04-19T20:29:22Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![diondiondion](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/diondiondion/32/16754_2.png) [@diondiondion](https://forum.getkirby.com/u/diondiondion)\
**Post date:** [April 20, 2015, 4:22pm UTC](https://forum.getkirby.com/t/add-active-class-to-current-link/847/6 "2015-04-20T16:22:32Z")

</div>

> [@texnixe](#):
>
> This is a bit strange, the code works for me and is also documented in the docs:

It doesn’t work in his case because he doesn’t use a loop to construct the menu, so that $page is the same for every menu item. In order for the code snippet to work in his case he’d have to adjust it slightly for each menu item, maybe like so:

```auto
...
<li <?php e($site->page('about')->isOpen(), ' class="active"') ?>>...</li>
<li <?php e($site->page('process')->isOpen(), ' class="active"') ?>>...</li>
...

```

---

_[View the full topic](https://forum.getkirby.com/t/add-active-class-to-current-link/847)._
