I am trying to remove some lines from function.php in Wordpress without making this permanent. My initial thought was to use a child theme. I understand that if you add "functions.php" as a child, it can be used to modify the parents function. Any recommendations? Thanks in advance for your support!!!
This is the code I want to target:
function top_bar_front_end_menu(){
$top_bar_status= esc_html ( get_option('wp_estate_enable_top_bar','') );
if($top_bar_status=='yes'){
$current_user = wp_get_current_user();
$username=$current_user->user_login ;$pages = get_pages(array(
'meta_key' => '_wp_page_template',
'meta_value' => 'user-dashboard-add.php'
));
if( $pages ){
$add_link = get_permalink( $pages[0]->ID);
}else{
$add_link='';
}
$pages = get_pages(array(
'meta_key' => '_wp_page_template',
'meta_value' => 'user-dashboard-profile.php'
));
if( $pages ){
$dash_profile = get_permalink( $pages[0]->ID);
}else{
$dash_profile=home_url();
}
$dash_link = get_dashboard_link();
print'<div class="top-user-menu-wrapper">
<div class="top-user-menu">
<div class="wellcome-user">';
$show_user_not_logged_in='';
$show_user_logged_in='';
if ( is_user_logged_in() ) {
$show_user_not_logged_in='geohide' ;
}else{
$show_user_logged_in='geohide';
}
$paid_submission_status = esc_html ( get_option('wp_estate_paid_submission','') );
print '
<div id="user_logged_in" class="'.$show_user_logged_in.'">';
if($dash_link!=''){
print ' <a href="'.$dash_link.'">'.__('My Properties','wpestate').'</a> | ';
}else{
print '<a href="'.$dash_profile.'">' .__('My Profile','wpestate').'</a> | ';
}
if($add_link!=''){
print '<a href="'.$add_link.'">' .__('List a Property','wpestate').'</a> | ';
}
print'
<a href="'.wp_logout_url().'">'.__('Log Out','wpestate').'</a>
</div>';
$front_end_register = esc_html( get_option('wp_estate_front_end_register','') );
$front_end_login = esc_html( get_option('wp_estate_front_end_login ','') );
print '
<div id="user_not_logged_in" class="'.$show_user_not_logged_in.'">
<a href="'.$front_end_login.'">'.__('Login','wpestate').'</a> |
<a href="'.$front_end_register.'">'.__('Register','wpestate').'</a>
</div>';
print'
</div>
</div>
</div>';
}
}