Tag Info

Hot answers tagged

2

As i got the solution so i am posting it here. Wordpress uses current-menu-ancestor and current_page_ancestor classes. So we can use them as below .mainmenu .current_page_item > a, .mainmenu .current_page_ancestor > a, .mainmenu .current-menu-item > a, .mainmenu .current-menu-ancestor > a { font-style: italic; }


1

change this line: $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; to: $item_output .= $args->link_before . apply_filters('the_title', substr($item->title, 0, 10), $item->ID) . $args->link_after; That limits the character to 10. Please note this substr($item->title, ...


1

The best way to customize a navigation menu is to use a custom 'walker' function.. Here are the steps how to achieve the customization that you want! Create a "wp-custom-nav-walker.php" file in your theme directory for a new custom 'walker' class. Extend the Walker_Nav_Menu class and copy the class' function that you want to modify and override it in the ...


1

You can use the WordPress function is_user_logged_in() to check that, and create some basic if statements to show and hide the appropriate code.


1

It seems that the OP have managed to solve his/her problem by doing this, which can be found at Different menus for logged-in users. if ( is_user_logged_in() ) { wp_nav_menu( array( 'theme_location' => 'logged-in-menu' ) ); } else { wp_nav_menu( array( 'theme_location' => 'logged-out-menu' ) ); } The more shorter way to achieve that is by ...


1

I'm making some assumptions here, like you are the one writing the code for the theme, or at least have the ability to modify the JavaScript in some way. You can accomplish this using jQuery using code along these lines: $(document).ready(function () { $('.parent ul').slideUp(); $('.parent > li > a').on('click', function (e) { ...


1

Add below code #site-navigation .menu > ul > li.menu-item-has-children > a::after { content: '\f107'; font-family: FontAwesome; font-size: 10px; margin-left: 10px; vertical-align: 1px; } #site-navigation .menu > ul > li > ul > li.menu-item-has-children > a::after { color: rgb(34, 34, 34); content: '\f105'; font-family: FontAwesome; ...


1

You Add Two time ("") Quote in you css see below Replace content: ""\f105""; To content: "\f105"; And Check Again



Only top voted, non community-wiki answers of a minimum length are eligible