URL for Menu to Logged-in User's Profile Page
-
I have been searching for some time and I see a lot of things that seem like answers yet to my headache encased mind, I think things are now flying over my head lol.
Simply put, what I want to do is create a url that I can put in menu bars or on tops of pages (menu bars better) that will take the logged in user, straight to their own profile. As it stands now, only thing I can do is go to members.
I’ve seen some fancy code like:
a href=”<?php bp_loggedinuser_link() ?>”> profile
and
function redirect2profile(){
include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ );
if($_SERVER[‘REQUEST_URI’] == ‘/profile/’ && is_plugin_active(‘buddypress/bp-loader.php’) && is_user_logged_in()){
global $current_user;
wp_redirect( get_bloginfo(‘url’) . ‘/members/’. $current_user->user_login . ‘/profile/’);
exit();
}
}
add_action(‘init’, ‘redirect2profile’);When searching for my answers, but none of that helps me with what I want. Once I saw something that instructed use %username% or something such, in the url like http://domain.com/members/%username% … but that ultimately didn’t pan out.
Does anyone have a simple solution? All I want is a url to the logged in user’s profile 🙂 for a menu bar 🙂
Thanks, you guys rock!
- The topic ‘URL for Menu to Logged-in User's Profile Page’ is closed to new replies.