Hi,
Find this code in class-wp-mobile-menu-core.php located at mobile-menu/includes/
if ( ! $titan->getOption( 'right_menu_icon_opt' ) || '' === $right_icon_image ) {
$output .= '<i class="mob-icon-' . $titan->getOption( 'right_menu_icon_font' ) . ' mob-menu-icon"></i><i class="mob-icon-cancel mob-cancel-button"></i>';
} else { $output .= '<img src="' .
$right_icon_image . '" alt="' . __( 'Right Menu Icon', 'mob-menu-lang' ) . '">';
}
and replace it by this one
$user_avatar = '';
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
$user_avatar = get_avatar( $current_user->user_email, 32 );
}
$output .= $user_avatar;
Let me know if it worked.
Thread Starter
ND
(@nigeltduke2)
one more question regarding this. So if the user is logged out, I see no icon or image shows for the right menu which is what I expected. But Is there a statement that can be inserted to show the regular right menu icon if the user is NOT logged in?
Great.
Replace this current code:
$user_avatar = '';
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
$user_avatar = get_avatar( $current_user->user_email, 32 );
}
$output .= $user_avatar;
by this one
$user_avatar = '';
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
$user_avatar = get_avatar( $current_user->user_email, 32 );
$output .= $user_avatar;
} else {
if ( ! $titan->getOption( 'right_menu_icon_opt' ) || '' === $right_icon_image ) {
$output .= '<i class="mob-icon-' . $titan->getOption( 'right_menu_icon_font' ) . ' mob-menu-icon"></i><i class="mob-icon-cancel mob-cancel-button"></i>';
} else { $output .= '<img src="' .
$right_icon_image . '" alt="' . __( 'Right Menu Icon', 'mob-menu-lang' ) . '">';
}
}
Can you send me your site url? I would love to have a look.
If you want to keep the url private send me an email to [support AT wpmobilemenu DOT com]
Thread Starter
ND
(@nigeltduke2)
Thread Starter
ND
(@nigeltduke2)
BTW that last code worked like a charm too!