WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Dynamic Highlighting Blog Page and Children

[Resolved] Dynamic Highlighting Blog Page and Children

  • Hi.

    I’ve just started using WordPress for the first time.

    I started off with…

    <li<?php if (is_page('blog')){ echo " class=\"current\"";}?>><a href="http://domain.com/blog/">Blog</a></li>

    Which after some searching on the forum I realised I needed to change it to…

    <li<?php if (is_home()){ echo " class=\"current\"";}?>><a href="http://domain.com/blog/">Blog</a></li>

    But I’m having trouble finding out how to keep the menu item highlighted for all the blog posts as well.

    Thanks in advanced to anyone who can point me in the right direction.

    mr.sly x

Viewing 1 replies (of 1 total)
  • Never mind fixed it. :

    For anyone searching who might want the same fix…

    <li<?php if (is_home()|| is_single()) { echo " class=\"current\"";}?>><a href="http://mrjohnsly.co.uk/blog/">Blog</a></li>

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Dynamic Highlighting Blog Page and Children’ is closed to new replies.
Skip to toolbar