This topic has 4 replies, 2 voices, and was last updated 6 years by Laura.

  • Author
  • #189354
     lucyelliottdesign
    Participant

    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

    #189419
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

    #189469
     lucyelliottdesign
    Participant

    Hi 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

    #189473
     lucyelliottdesign
    Participant

    I think it’s stopped working since I updated the theme?

    #189567
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?