• Resolved kreestal

    (@kreestal)


    Hello,

    Here is my blog. Thanks to wp_list_pages and to wp_list_categories, with some CSS work, I can show the readers where they are located when they browse the site. I.e if they’re browsing the “Pensées” category, the category list item “Pensées” goes bold.

    It works for my category list as well as my navigation list, that includes “A propos de Marie” until “Contact”.

    However, I added another link at the top of the navigation link which is “Accueil” (= “Home”), which does not belong to the wp_list_pages loop. I would like it to go bold, too, when you are located on my blog’s root, that is to say bon https://www.bloodymarie.fr

    How can you make this possible?

    Many, many thanks for your precious help!*

Viewing 1 replies (of 1 total)
  • Thread Starter kreestal

    (@kreestal)

    The solution is:
    <li <?php if(is_home()){echo 'class="current_page_item"';}?>><a href="<?php bloginfo('siteurl'); ?>" title="Homepage">Homepage</a></li>

Viewing 1 replies (of 1 total)
  • The topic ‘Highlight the homepage item in navigation’ is closed to new replies.