Active page link colour
-
Hello,
I’m trying to figure out why the “News” link at the top of my page is not changing colours (like the “About” page) when active. I set it as the home page (through Settings > Reading), so I’d like the active link to be the correct colour when the user is on the home page AND the News page. Or at least the News page.
Any help would be appreciated.
-
http://marqspusta.com/7.0/news/ is post http://marqspusta.com/7.0/about/ is page, that’s why π This doesn’t seem to be dynamic menu?
your:
.current_page_item, .current_page_item a { text-decoration: none; color: #442604; }applies to pages, not to posts.
Yeah, it’s not dynamic.
OK, thanks, I changed it back to a dynamic menu. So how could I make the “News” link colour active when you’re on the home page?
It is now when you made this dynamic http://marqspusta.com/7.0/news/
Yup, that looks great. I’m concerned with the home page here. Or could I get rid of the home page somehow and make it the “News” page? I went to Settings > Reading and changed it to this: http://www.queueban.com/del/wp_active.png
I basically want a way to change the “home” page name into “news”, but I don’t think WordPress allows this. I did make my own theme though, so perhaps there’s a way I can code it?
That will do the trick if you want News to be your homepage.
The problem is that the link in the navigation bar doesn’t change when you’re on the home page.
If the News is you current page on http://marqspusta.com/7.0/ the News will not be highlighted, only if you click on http://marqspusta.com/7.0/news/ but I don’t think that this link should be even clickable if you made “news” as you home page via Settings.
When you say the nav doesn’t change what do you mean by that?
The colour.
I just changed the “Home” page back to recent posts instead of making it the “News” page. So you’ll see two different links at the top. But still, the link doesn’t change colour when you’re on the second “News” link at the top, which is the home page.
This is the code:
<li><a href="<?php echo get_option('home'); ?>/" >News</a></li> <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=');?>Second News is your Home so they don’t highlight see the code now and News is highlighted once you click on it.
<li><a href="<?php <?php echo home_url(); ?>/" >Home</a></li> <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=');?>
The topic ‘Active page link colour’ is closed to new replies.