Search found 4 matches

by Tim
Tue May 19, 2020 9:47 pm
Forum: General
Topic: Add class to menu item.
Replies: 8
Views: 3483

Re: Add class to menu item.

funny, it works correctly on hosting, but it doesn't work on the local server
by Tim
Tue May 19, 2020 1:39 pm
Forum: General
Topic: Add class to menu item.
Replies: 8
Views: 3483

Re: Add class to menu item.

Is there a link to the installation? http://bludit.eu5.net/ <!-- Static pages --> <?php $current_page = $_SERVER['REQUEST_URI']; foreach ($staticContent as $staticPage) : ?> <li <?php if ($current_page == '/' . $staticPage->slug()) echo 'class="current-menu-item"'; ?>> <a href="<?php...
by Tim
Tue May 19, 2020 11:34 am
Forum: General
Topic: Add class to menu item.
Replies: 8
Views: 3483

Re: Add class to menu item.

Edi wrote: Tue May 19, 2020 11:24 am Have you defined a CSS class "current"?
Yes, I'm porting a wordpress theme, all classes exist.
by Tim
Tue May 19, 2020 9:59 am
Forum: General
Topic: Add class to menu item.
Replies: 8
Views: 3483

Re: Add class to menu item.

Edi wrote: Tue Jan 29, 2019 7:54 pm The theme Keep It Simple gives you an example:

https://github.com/bludit-themes/keep-i ... ar.php#L29
I'm also looking for a solution. I downloaded the theme, but it doesn't work, class='current' does not apply to the current page