Adjustment to login header code

This is a PRIVATE forum for verified users only, to view all replies/answers, you must be logged in!

Status: resolved
  • This topic has 5 replies, 4 voices, and was last updated 5 y, 12 mo by  1cocuk.
Viewing 5 reply threads
  • Author
    Posts
    • #10834

      Thakksy
      Member

      Hey, so i’ve decided to remove buddypress from my site because not many users were actually using it and buddypress uses so much resources it’s just not worth having it, But will keep bbpress.

      You guys provided me with some custom login code a few months ago but after deactivating buddypress when a user clicks the small avatar to go to their frontend profile it now takes them to the backend admin profile. how to make it so that user will be taken to their frontend bbpress profile instead.

      my site is http://www.cruisehive.com

      Here is the code below that will need adjusting and thanks so much:

      add_filter( 'wp_nav_menu_items', 'yt_custom_menu_login_feb012014', 15, 2 );
      
      if ( ! function_exists( 'yt_custom_menu_login_feb012014' ) ) {
      
      	function yt_custom_menu_login_feb012014 ( $items, $args ) {
      
      		if( $args->theme_location == 'primary' && 'hide' ){
      			
      			$args = array(
      		        'echo'           => false,
      		        'redirect'       => site_url( $_SERVER['REQUEST_URI'] ), 
      		        'form_id'        => 'loginform',
      		        'label_username' => __( 'Username' ),
      		        'label_password' => __( 'Password' ),
      		        'label_remember' => __( 'Remember Me' ),
      		        'label_log_in'   => __( 'Log In' ),
      		        'id_username'    => 'user_login',
      		        'id_password'    => 'user_pass',
      		        'id_remember'    => 'rememberme',
      		        'id_submit'      => 'wp-submit',
      		        'remember'       => true,
      		        'value_username' => NULL,
      		        'value_remember' => false
      			);
      			if( !is_user_logged_in() ){
      
      				$login_from = wp_login_form( $args );
      				$social_login = function_exists( 'wsl_render_auth_widget' ) ? wsl_render_auth_widget() : '';
      				$items .= sprintf( '<li class="menu-item menu-item-type-custom menu-item-login default-dropdown sub-menu-left pull-right">
      						<a href="javascript:void(0)" title="' .  __('Login', 'wpthms' ) . '"><i class="fa fa-user"></i> %s</a>
      						<ul class="sub-menu">
      							<li class="menu-item">
      								<div class="widget_login_form">%s</div>
      							</li>
      							%s
      							<li><a href="%s">Register</a> <a href="%s" title="Lost Password">Lost Password</a></li>
      						</ul>
      					</li>',
      					__('Login', 'wpthms'),
      					$login_from,
      					sprintf('<li>%s</li>', $social_login ),
      					esc_url( wp_registration_url() ),
      					esc_url( wp_lostpassword_url() )
      				);
      			}else{
      				global $current_user;
      				$profile = sprintf( '<a class="tooltips" href="%s" title="My Profile">%s</a>',get_edit_user_link(),  get_avatar( $current_user->ID, 20 ) );
      				$logout = '<a href="' . esc_url( wp_logout_url( get_permalink() ) ) . '" title="logout">LOG OUT</a>';
      				$items .= sprintf('<li class="menu-item menu-item-type-custom menu-item-login default-dropdown sub-menu-left pull-right">%s</li>', $profile . ' ' . $logout );
      			}
      		}
      
      		return $items;
      	}
      }
    • #10854

      Jacob
      Staff

      Hey there, You must be logged in to view this reply!

      Login | Register | Forgot Password?

    • #10858

      Thakksy
      Member

      worked perfectly, thanks for your help 🙂

    • #11772

      1cocuk
      Member
      This reply has been marked as private.
    • #11785

      Max
      Staff

      Hey there, You must be logged in to view this reply!

      Login | Register | Forgot Password?

    • #11790

      1cocuk
      Member

      Thank you very much Maxxi. 🙂

Viewing 5 reply threads
  • You must be logged in to reply to this topic.

This is a PRIVATE forum for verified users only, to view all replies/answers, you must be logged in!

© Copyright 2021 by wpthms.com. All Rights Reserved.