Highlight main blog link while on single post

Community Forums Forums General Discussion Highlight main blog link while on single post

This topic is: resolved

Tagged: 

This topic contains 1 reply, has 1 voice, and was last updated by  emasai 1 year, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #57103

    emasai
    Participant
    Post count: 669

    I have been searching high and low for the answer to this to no avail. I am trying to highlight the Blog link from the primary nav when on a single post. I only have 1 category ‘show’ which is not on the nav and the menu item id for the Blog page is 19. I have moved the nav into the header as per below

    /**  Remove the Primary Navigation and
    Move navigation into header */
    remove_action( 'genesis_after_header', 'genesis_do_nav' );
    add_action('genesis_header', 'genesis_do_nav');

    This is function, but nothing is highlighted so am I targeting the wrong hook???

    function blog_link_genesis() {
    	if( is_single() && in_category('show')) { 
    	$current = '#header .menu .current-menu-item #menu-item-19 a';  }
    	?>
    
    	<style type="text/css">
    	<?php echo $current; ?> { color: #ef4634;}
    	</style>
    	<?php }
    
    add_action( 'genesis_header' , 'blog_link_genesis'  );
    

    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    #57113

    emasai
    Participant
    Post count: 669

    Fixed it, my css was wrong, I had to add this

    #header .menu .current-menu-item #menu-item-19 a{
    color: #ef4634;
    }

    Not quite sure why $current does not do the job, but now it works. If a guru would care to explain, please do.


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.