Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
Exclude Post Format from next_post and prev_post
Twenty Eleven theme- have custom landing page, change nav “home” link
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’ ) ); ?>
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
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
Rendering of custom walker menu function not working properly
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
Finally, after some thorough search and as suggested by @Howdy_McGee in his comment I got the Nav Walker working as expected. For those looking for something similar, here is how I did it. Instead of outputting parent menu item title in start_lvl function, I included it in start_el function and the final code looked like … Read more
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