Kriesi.at - Wordpress Themes and HTML Templates

  • Home
  • Themes
  • Blog
  • Support
  • About
  • Contact

Support Forum » Display
resolved

change menu description color

24 posts from 3 voices
  • Started 1 year ago by brouge
  • Latest reply from Dude
  • This topic is resolved

Tags:

  • Current
  • description color
  • display
  • highlight blog link in menu when showing single post
  • highlight current blog nav for single article
  • highlight parent menu item
  • menu
  • menu-id
  • menu-item
  • NAV
  • single
  • submenu width
  1. brouge
    Member

    i was woundering how to chang the menu description color (the little subline from a main point).
    i'd like to have the current and the hover the same color and the nonactive one always black.

    Posted 1 year ago #
  2. Dude
    Dude

    Hey,
    you can use following code in style1/2/3.css:

    .nav li a:hover, .nav li a:hover span, .nav li .current_page_item a span{
    color: #fff;
    }

    You can change the color value of course :)

    Posted 1 year ago #
  3. brouge
    Member

    since i only want to change the hover for the little span i insert the following code into the style1.css.

    .nav li a:hover span, .nav li .current_page_item a span{color: #8bbf00;}

    this is working for hovering.
    but now the currentpage is not logged in the menu. even the white main description is shown grey.
    how do i make them react right?

    Posted 1 year ago #
  4. Dude
    Dude

    Instead of:

    .nav .currentli_item a, .nav li a:hover{
    color:#fff;
    }

    use:

    .nav .current-menu-item a, .nav li a:hover{
    color:#fff;
    }
    Posted 1 year ago #
  5. brouge
    Member

    i tried this and it works for fine for the main menu.
    to get it changed for the description also you have to enter the following snipped in the style1.css:

    .nav .current-menu-item a, .nav li a:hover{color:#fff;} /* main menu */
    .nav li a:hover span, .nav .current-menu-item a span{color: #8bbf00;} /* main menu description */

    thanks dude!

    Posted 1 year ago #
  6. brouge
    Member

    for the little i-dot,

    how can i change the behaviour of the submenus according to there parrent page?
    i'd like to highlight the main menu item when you are at a sub.page so that you know in which menu point of the site you are.
    i tried something with

    .nav li ul.current-menu-ancestors a {color: #fff;}

    but this won't work

    Posted 1 year ago #
  7. brouge
    Member

    and how do i change the width of the submenu to 130px?
    best regards

    Posted 1 year ago #
  8. Dude
    Dude

    Try:

    .nav .current-menu-ancestors a span {color: #fff;}
    
    #top .nav li ul a {
    width: 130px;
    }
    
    #top .nav ul {
        width: 152px;
    }
    Posted 1 year ago #
  9. brouge
    Member

    .nav .current-menu-ancestors a span {color: #fff;}

    does not work - any other ideas?

    Posted 1 year ago #
  10. brouge
    Member

    allright, i got this one!
    to highlight the parent menu item from a subpage enter the following code in your style.css or style1/2/3.css

    .nav .current-menu-parent a {color:#fff;} /* main menu */<br />
    .nav .current-menu-parent a span {color:#8bbf00;} /* main menu description */
    Posted 1 year ago #
  11. brouge
    Member

    okay, last thing ;-)
    how can you get this behaviour working with post?
    whenever i show a simple post from the blog category i'd like to highlight the menu item that links to the blog.
    ir tried
    .nav .current-post-parent a {color:#fff;}
    with no result.

    Posted 1 year ago #
  12. Dude
    Dude

    I'm sorry - there's no class which highlights the blog page of a post. I.e. it's not possible to highlight "Blog" while you're on "neuauflage".

    Posted 1 year ago #
  13. brouge
    Member

    thanks for the information.
    i found http://www.vanseodesign.com/wordpress/hightlight-current-page-wordpress/
    which tells you that it works, but i don't know where to implement the code snippet for the menu.

    very last question for this whole subject.
    when hovering to a subpage (e.g. analysis) is it possible to keep the parent.page (buchvorstellung) highlighted?

    Posted 1 year ago #
  14. Dude
    Dude

    The tutorial: http://www.vanseodesign.com/wordpress/hightlight-current-page-wordpress/ refers to the old wp_list_page function which was used before wp3 intoduced custom menus. Display uses: http://codex.wordpress.org/Function_Reference/wp_nav_menu to generate the menus - unfortunately this tutorial is useless.

    Posted 1 year ago #
  15. brouge
    Member

    how about this tutorial for the new menu system:
    http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category/

    any news for the hover parent effect?
    best regards

    Posted 1 year ago #
  16. brouge
    Member

    hey dude i was thinking i found the solution to keep the blog menu item highlighted when reading a single post.
    into the wordpress 3 menu manager and tick show advanced settings.
    then you can add css-classes to each item of the menu.
    i add
    current-menu-parent
    to the site that links to your blog.

    but it keeps highlighting it consistantly even when i am at another page

    i put the current hover effect to a new thread:
    http://www.kriesi.at/support/topic/navigation-current-parent-highlight-hover

    Posted 1 year ago #
  17. Dude
    Dude

    Yes but it doesn't work nevertheless. The problem is that wp doesn't know which categories are part of the blog. It would require a custom function which determines all blog categories, all posts which are part of the blog and based on the result it checks if certain menu classes are required/can be set or not. Another solution would be to work with http referer but it's a very case sensitive solution too. The only "easy" solution is to display an archive instead of the blog page because you can use:

    .current-post-ancestor {
    
    }

    afterwards. The drawback is that you can display one category as blog only instead of severals or all (Display's blog page). It doesn't help to "hardcode" classes like "current-menu-parent" because WordPress needs to decide dynamically which classes are required and which not.

    Posted 1 year ago #
  18. brouge
    Member

    hey dude

    #top .nav .current-post-ancestor a{color:#fff;}
    #top .nav .current-post-ancestor a span{color:#8bbf00;}

    works but whenever i go to the portfolio site the blog menu item is highlighted too.
    how do i exlude the portefolio category from this behaviour.

    best regards

    Posted 1 year ago #
  19. brouge
    Member

    i think i found a solution but i need some advice.
    couldn't it be solved by adding a conditional class to the blog menu item when show a single article.
    and then use .blog in the style.css to highlight the menu-item?

    but i don't know how to connect

    <?php if (is_single()) { ?> class="blog"
    <?php }

    with

    wp_nav_menu( array( 'menu' => 'First', 'menu_class' => 'nav', 'echo' => true,
    	'fallback_cb' => 'displayfallbackSlider', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
    	'depth' => 0, 'context' => 'frontend',  'walker' => new description_walker() ));

    best regards
    thomas

    Posted 1 year ago #
  20. Chris Beard

    You can modifty it to be like this:
    'menu_class' => 'nav blog'
    This way your menu will be classed as both nav and blog and can therefore be styled with ".nav .blog"
    You should be able to do it by using the your if statement to either display

    // Menu Controlled by the Backend
            wp_nav_menu( array( 'menu' => 'First', 'menu_class' => 'nav', 'echo' => true,
    	'fallback_cb' => 'displayfallbackSlider', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
    	'depth' => 0, 'context' => 'frontend',  'walker' => new description_walker() ));

    or

    // Menu Controlled by the Backend
    	wp_nav_menu( array( 'menu' => 'First', 'menu_class' => 'nav blog', 'echo' => true,
    	'fallback_cb' => 'displayfallbackSlider', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
    	'depth' => 0, 'context' => 'frontend',  'walker' => new description_walker() ));

    So you'd do something like: if you're on a single page you'd display menu x else you'd display menu y.

    Posted 1 year ago #
  21. brouge
    Member

    thanks for the answer, but can you be a little more precise.
    what is the exact code to enter in the header.php.

    and will it really work? i tried it with 'menu_class' => 'nav blog' and the thing is that every menu item gets highlighted.
    which is logical because the code above means that every menu item gets the class "blog" in addition.
    maybe the correct solution will be to give the navigation element (menu-item-91 = my blog) a conditional class.
    how can you achieve this goal?

    best regards

    Posted 1 year ago #
  22. brouge
    Member

    i found out another interessting thing.

    letting everything like it is and adding the following snippet into the style1.css

    .single li a {color:#fff;}
    .single li a span{color:#8bbf00;}

    changes all the menu items without using if then else double wobble menues in the header.

    if we can now get the only menu-item-91 using the css this topic should be solved

    Posted 1 year ago #
  23. brouge
    Member

    yeeeeeeeeeeeeeeeeeeeeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!
    finally i got this problem solved:

    i simply added the following snipped the style1.css

    .single li#menu-item-91 a {color:#fff;}
    .single li#menu-item-91 a span{color:#8bbf00;}

    works like a charm. take a look at the blog-page http://www.mathemitnullplan.de/neuigkeiten and click any post you want.
    the blog menu-item in the navigation keeps on being highlighted.
    if you want to use this too, make sure to find the right number of the div-id that links to your blog. mine is 91 yours might be different.

    best regards
    thomas

    Posted 1 year ago #
  24. Dude
    Dude

    Glad that you found a solution :)

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Log inRegister a new Account

Support Forum usage - Please read

It takes 3 Steps to get you started

Please start by registering an account for this forum here

Create a new thread and tell me what problems you are encountering and what you want to know.

There is no step 3 :)
We try to answer all questions within a day, monday-friday.



Check out some of our WordPress Themes

  • Eunoia - Responsive Portfolio
  • Avisio - Business and Portfolio
  • Replete e-Commerce and Business
  • Display 3 in 1 - Business & Portfolio HTML Theme
  • BrightBox - Business & Portfolio Wordpress Theme
  • Angular - Responsive Portfolio
  • Flashlight - fullscreen background portfolio theme
  • BroadScope Wordpress Theme
  • Choices - Responsive Business and Portfolio

Blog Categories

  • Article
  • CSS Tutorials
  • Design
  • Freebies
  • HTML Template
  • Javascript
  • Miscellaneous
  • Photoshop Tutorial
  • Tutorials
  • Wordpress
  • WordPress Plugins
  • WordPress Themes
  • Wordpress Tutorial

Latest Themes

  • Abundance eCommerce Business Theme
  • Angular - Responsive Portfolio
  • Propulsion - responsive business & eCommerce
  • Flashlight - fullscreen background portfolio theme
  • Corona - Business & Portfolio Theme
  • Shoutbox Magazine
  • Expose Gallery Template - 3 in 1
  • Cubit 6 in 1- Business & Portfolio Theme
  • Newscast 4 in 1 - Wordpress Magazine and Blog

Pages

  • About
  • Blog
  • Contact
  • Legal Information
  • Support
  • Themes

About me…

Heya! I am Kriesi, a vienna based webdesigner specialized in building sleek and affordable WordPress themes and HTML Templates. Want to know more about me? Read more
© Copyright Kriesi.at – Wordpress Themes and HTML Templates
  • RSS
  • Facebook
  • Twitter
top