Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Removing highlight from subpages when parent page selected. Wordpress

    Hei

    I have been looking around, but haven't found any solution to my problem that wold actually work.

    Maybe some of you may know the answer.

    I have a menu with a submenu on my wordpress webpage, my problem is that when I click on the page then all the subpages in the menu are also highlighted. How can I remove that? (So only the parent page would be highlighted until I click on one of the submenus)

    Here it is: http://lintech.fi/

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by krispol View Post
    Hei

    I have been looking around, but haven't found any solution to my problem that wold actually work.

    Maybe some of you may know the answer.

    I have a menu with a submenu on my wordpress webpage, my problem is that when I click on the page then all the subpages in the menu are also highlighted. How can I remove that? (So only the parent page would be highlighted until I click on one of the submenus)

    Here it is: http://lintech.fi/
    Go to your stylesheet here:
    http://lintech.fi/wordpress/wp-content/themes/amdhas/style.css

    ...and comment out this line (line 1,995):

    Code:
    #navmenu li.current_page_item a,  
    
    #navmenu li.current-menu-item a,
    #navmenu2 li.current_page_item a,  
    
    #navmenu2 li.current-menu-item a {
    
    	color: #000;
    
    }
    That should sort it out...
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Rowsdower! View Post
    Go to your stylesheet here:
    http://lintech.fi/wordpress/wp-content/themes/amdhas/style.css

    ...and comment out this line (line 1,995):

    Code:
    #navmenu li.current_page_item a,  
    
    #navmenu li.current-menu-item a,
    #navmenu2 li.current_page_item a,  
    
    #navmenu2 li.current-menu-item a {
    
    	color: #000;
    
    }
    That should sort it out...
    Thanks for the quick reply!

    Did it, it indeed removes the highlight, but now there is no highlight at all. If I select one of the main pages the subpages are not highlighted which is what I wanted but the main page itself now unfortunately is also not highlighted

  • #4
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Oops! Sorry about that. Instead of commenting out the line just make these changes:

    Code:
    #navmenu li.current_page_item>a,  
    
    #navmenu li.current-menu-item>a,
    #navmenu2 li.current_page_item>a,  
    
    #navmenu2 li.current-menu-item>a {
    
    	color: #000;
    
    }
    That makes it apply only to anchor tags that are the IMMEDIATE child of the "current" <li> element.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • Users who have thanked Rowsdower! for this post:

    krispol (10-05-2012)

  • #5
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Rowsdower! View Post
    Oops! Sorry about that. Instead of commenting out the line just make these changes:

    Code:
    #navmenu li.current_page_item>a,  
    
    #navmenu li.current-menu-item>a,
    #navmenu2 li.current_page_item>a,  
    
    #navmenu2 li.current-menu-item>a {
    
    	color: #000;
    
    }
    That makes it apply only to anchor tags that are the IMMEDIATE child of the "current" <li> element.
    Got it! Thank you!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •