You can’t override the function(s). They aren’t meant to be overwritten. See: “Override parent theme function that is not hooked or in the functions.php file” and “Is it possible to disable a function of a parent theme?”. That is the direct answer to your question.
You can, however, almost certainly achieve the result you want by using the filter provided by the theme– udesign_get_top_main_menu
— or any number of filters provided by wp_nav_menu()
or by the Walker_Nav_menu
class— perhaps wp_nav_menu_objects
or wp_nav_menu_items
.
Per the question, you are wanting to remove:
$menu_html .= is_front_page() ? "<li class="current_page_item">" : "<li>"; $menu_html .= '<a href="'.home_url().'"><span>'.esc_html__('Home', 'udesign').'</span></a></li>';
Ok. You probably need to use the filter provided in the code posted:
function udesign_strip($menu) {
var_dump($menu);
$menu_html = is_front_page() ? "<li class="current_page_item">" : "<li>";
$menu_html .= '<a href="'.home_url().'"><span>'.esc_html__('Home', 'udesign').'</span></a></li>';
$menu = str_replace($menu_html,'',$menu);
return $menu;
}
add_filter('udesign_get_top_main_menu','udesign_strip');
I don’t like str_replace
ing markup but that is probably the best way in this case.