Adjustment to login header code

This topic is: Resolved

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

This topic contains 5 replies, has 4 voices, and was last updated by  1cocuk 1 year, 1 month ago.

  • Author
    Posts
  • #10834

    Thakksy
    Member
    Post count: 321

    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', 'yeahthemes' ) . '"><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', 'yeahthemes'),
    					$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
    Post count: 2323

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

    Login | Register | Forgot Password?

  • #10858

    Thakksy
    Member
    Post count: 321

    worked perfectly, thanks for your help 🙂

  • #11772

    1cocuk
    Member
    Post count: 26
    This reply has been marked as private.
  • #11785

    Max
    Staff
    Post count: 3150

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

    Login | Register | Forgot Password?

  • #11790

    1cocuk
    Member
    Post count: 26

    Thank you very much Maxxi. 🙂

You must be logged in to reply to this topic.

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