• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Highlight main blog link while on single post

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: resolved

Tagged: php

  • This topic has 1 reply, 1 voice, and was last updated 13 years, 2 months ago by emasai.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 17, 2013 at 5:44 pm #57103
    emasai
    Participant

    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

    August 17, 2013 at 7:33 pm #57113
    emasai
    Participant

    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

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble