-
Author
-
February 21, 2018 at 17:01 #189354lucyelliottdesignParticipant
Hi there,
I wanted to create a link to the profile in navigation and on a page so I added the following code:
/* Redirects to profile upon login, & logged out users are redirected to register page */
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’);
I then created a profile page. It was working for ages, but now isn’t.
I also tried your ##profile_link##profile/, found here: https://archived.seventhqueen.com/kleo/article/building-dynamic-buddypress-menu
But that’s not working either? Do you know why this may be or have any solutions?
Thanks,
Lucy
February 21, 2018 at 20:42 #189419LauraModeratorHello, that code is for a redirection, not to create a link. Can you try to find the one you used so I can check it?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
February 22, 2018 at 12:48 #189469lucyelliottdesignParticipantHi Laura,
I then created a page called Profile and then used the url /profile in the navigation. It worked for a while but then stopped.
I basically want a dropdown in the menu for Profile. I followed the article you mentioned but it didn’t work either!
Thanks! Luyc
February 22, 2018 at 13:45 #189473lucyelliottdesignParticipantI think it’s stopped working since I updated the theme?
February 23, 2018 at 01:59 #189567LauraModeratorHello, by default it shouldn’t work because profile pages are dynamic so /profile would never work ( with buddypress, not related to the theme ) But you could try Buddypress Menu plugin
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.