Change header menu login-logout without changing main menu

You should add a class to the header when the user is logged in, this way, only your css would have to change. You can do it like this in your header.php file : <header class=”header clear <?php echo ((is_user_logged_in())?’logged-in-header’:’not-logged-in-header’); ?>” role=”banner”>

How to get the title of root li element

In a nutshell, assuming you are using a walker to construct your menu. E.g. when customizing the start_el() method, the $item should be an object – somewhat – like the $post object. In reverse that means, you have access to post_parent property. With that information you can retrieve the title with get_the_title() easily. After your … Read more

Add extra markup to WP menus

When developing a menu on a bootstrap based theme, I now use the following Walker: ‘walker’ => new Custom_Walker_Nav_Menu class Custom_Walker_Nav_Menu extends Walker_Nav_Menu { // add classes to ul sub-menus function start_lvl( &$output, $depth ) { // depth dependent classes $indent = ( $depth > 0 ? str_repeat( “\t”, $depth ) : ” ); // … Read more

Different menu on different category need advice

This is a good way, Mardov. Another way is to specify the subcategory id in the in_category array which is easier method. For example: if (in_category( array( 2, 4, 5 ) ) { // 2, 4 & 5 can be a category or a subcategory wp_nav_menu( array( ‘menu_class’ => ‘menu’,’menu’ => ‘Visuomenei’) ); } You … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)