Show All Courses link in Category, Post Mega Menu

If you’re using MegaMenu type : Category – Post type as in below image, you can display an all-courses directory  link using below code :

http://prntscr.com/mwqx15

 

add below code in Child theme – functions.php

add_filter(‘walker_nav_menu_start_el’,function($item_output, $item){

if($item->megamenu_type == ‘cat_posts’){
$courses_url = get_permalink(vibe_get_bp_page_id(‘course’));
$item_output .= ‘<a href=”‘.$courses_url.'” class=”megamenu_all_courses_link” style=”position: absolute;right: 0px;bottom: 0px;z-index: 99;”>’.get_the_title(vibe_get_bp_page_id(‘course’)).'</a>’;
}
return $item_output;
},10,2);

Leave a Reply

Your email address will not be published. Required fields are marked *