Home › Forums › WoodMart support forum › Remove two section › Reply To: Remove two section
April 14, 2018 at 6:15 am
#52480

Artem Temos
Keymaster
Try to add the following PHP code snippet to the child theme functions.php file to do this
function woodmart_get_header_links() {
$links = array();
if( ! woodmart_woocommerce_installed() ) return $links;
$login_dropdown = woodmart_get_opt( 'login_dropdown' );
$links_with_username = woodmart_get_opt( 'links_with_username' );
$color_scheme = whb_get_dropdowns_color();
if( whb_is_enabled() ) {
$settings = whb_get_settings();
$login_dropdown = isset( $settings['account'] ) && $settings['account']['login_dropdown'] && ( ! $settings['account']['form_display'] || $settings['account']['form_display'] == 'dropdown' );
$links_with_username = isset( $settings['account'] ) && $settings['account']['with_username'];
}
$account_link = get_permalink( get_option('woocommerce_myaccount_page_id') );
$current_user = wp_get_current_user();
if( is_user_logged_in() ) {
$links['my-account'] = array(
'label' => esc_html__('My Account', 'woodmart'),
'url' => $account_link,
'dropdown' => ''
);
if ( $links_with_username ) {
$links['my-account']['label'] = sprintf( esc_html__( 'Hello, %s', 'woodmart' ), '<strong>' . esc_html( $current_user->display_name ) . '</strong>' );
}
} else {
$links['register'] = array(
'label' => esc_html__('Login / Register', 'woodmart'),
'url' => $account_link
);
if( $login_dropdown ) {
$links['register']['dropdown'] = '
<div class="sub-menu-dropdown color-scheme-' . $color_scheme . '">
<div class="login-dropdown-inner">
<h3 class="login-title"><span>' . esc_html__('Sign in', 'woodmart') . '</span><a class="create-account-link" href="' . esc_url( $account_link ) . '">' . esc_html__('Create an Account', 'woodmart') . '</a>' . '</h3>
' . woodmart_login_form( false, $account_link ) . '
</div>
</div>
';
}
}
return apply_filters( 'woodmart_get_header_links', $links );
}