Two Navigation Menus – secondary nav is including main nav

In your theme’s functions.php did you register a new WP Menu ? by using a code like this: register_nav_menus( array( ‘secondary’ => __( ‘Secondary Navigation’, ‘twentyten’ ), ) ); And after that in your theme’s header.php under <div id=”access” role=”navigation”> you should add <?php wp_nav_menu( array( ‘container_class’ => ‘menu-header-secondary’, ‘theme_location’ => ‘secondary’ ) ); ?>

Page navigation doesn’t show when query category

I found a partial workaround. Since the query object in the index.php is the right one I transferred it using serialize to template of choice, in this case category-video.php. In index.php i put on top <?php $s = serialize($wp_query); file_put_contents(‘query’,$s); ?> and in category-video.php I put <?php $u = file_get_contents(‘query’); $wp_the_query = unserialize($u); ?> It’s … Read more

Nav Walker current menu item not displaying

Since it is working as you expect in the header.php file (but not in sidebar.php), you could add this into header.php: global $my_nav; $my_nav= wp_nav_menu( array( ‘menu’ => ‘main-menu’, ‘container’ => ”, ‘container_class’ => ‘navbar-blue’, ‘menu_class’ => ‘nav’, ‘menu_id’ => ‘main-menu’, ‘walker’ => new Bootstrapwp_Walker_Nav_Menu(), ‘echo’ => 0, ) ); ?> and then in your … Read more

Programmatically set current-menu-item using wp_nav_menu

Adding Conditional Classes to Menu Items This example would let you add a custom class to a menu item based on the condition you specify. Don’t forget to change the condition. <?php add_filter(‘nav_menu_css_class’ , ‘special_nav_class’ , 10 , 2); function special_nav_class($classes, $item){ if(is_single() && $item->title == “Blog”){ //Notice you can change the conditional from is_single() … Read more

connect last post with first post

You may install this plugin and then for the next link, use: <?php c2c_next_or_loop_post_link(‘%link’,'<img src=”https://wordpress.stackexchange.com/questions/259353/img-location”/>’); ?> and for the previous link use: <?php c2c_previous_or_loop_post_link(‘%link’,'<img src=”https://wordpress.stackexchange.com/questions/259353/img-location”/>’); ?> That’s it. Now the previous link of your first post should be the last post and the next link of your last post should be the first post. If … Read more

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