Current Post Parent Category & Child Category Links

Display the categories (or terms from other taxonomies) assigned to a post ordered by parent-child category relationship. Similar to the function get_the_category_list() which orders the categories by name. This example must be used inside the loop. <?php $taxonomy = ‘category’; // Get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( ‘fields’ … Read more

wp_nav_menu doesn’t seem to work on custom post type pages

You can just add these parameters in array variable and pass this to wp_nav_menu() Like: function get_menu_params(){ $defaults = array( ‘menu’ => ‘Primary Menu’, ‘theme_location’ => ‘primary’, ‘depth’ => 3, ‘container’ => ‘div’, ‘container_class’ => ‘a’, ‘container_id’ => ‘b’, ‘menu_class’ => ‘nav navbar-nav’, ‘fallback_cb’ => ‘wp_bootstrap_navwalker::fallback’, ‘walker’ => new wp_bootstrap_navwalker() ); return $defaults; } and … Read more

Need help with adding custom wordpress menu and sub-menu

Use this code bellow to dynamic you nav: <?php $args = array( ‘theme_location’ => ”, ‘menu’ => ‘Main’, ‘container’ => ‘false’, ‘container_class’ => ”, ‘container_id’ => ”, ‘menu_class’ => ‘cs-main-navigation cs-clearfix’, ‘menu_id’ => ”, ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ => ”, ‘after’ => ”, ‘link_before’ => ”, ‘link_after’ => ”, ‘items_wrap’ => ‘<ul … Read more