• Resolved Moritz83

    (@moritz83)


    Hi,

    I would like to change the color of the last nav item (LIVE) from black to red and bold in every state (normal, hover, clicked). Is this possible?
    Just the nav text, not the title on the page ??

    This is my page: Click me/

    Thank you in advance
    Moritz

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey,

    Yes, this is possible.

    In your child theme’s style.css file use the following CSS:

    .page-item-3654 a, .page-time-3654 a:hover {
    color: COLOURVALUE !important;
    font-weight: bold;
    }

    Replace COLOURVALUE with the value of the colour you want the link to be.

    Hope this helps. Let me know if there’s any problems with it.

    Thread Starter Moritz83

    (@moritz83)

    Great!

    Thank you very much!

    Glad it worked. ??

    Yes, it’s possible, but with some elbow grease. You will need to make a custom menu with some code like below that you would replace the current menu’s code in your header.php file.

    <div style="text-align: center; padding-bottom: 30px; width: 100%;">
    <?php
    $pages = get_pages('sort_column=menu_order');
    foreach ($pages as $page) {
      	if ($page->post_title != "LIVE!") {$option = '<a style="color: #444; text-decoration: none;" href="';} else {$option = '<a style="color: red; text-decoration: none;" href="';}
      	$option .= get_page_link($page->ID);
      	$option .= '"><div style="display: inline; padding-left: 6px; padding-right: 6px;">';
    	$option .= $page->post_title;
    	$option .= '</div></a>';
    	echo $option;
      }
    ?>
    </div>

    That may not be the exact code, but it should give you a good starting point. If you still have questions after you edit the code (if you still choose to), feel free to post them here, and I’ll be more than happy to help!

    EDIT: Sorry! Looks like you got it figured out. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Style last nav item’ is closed to new replies.