• I have buddypress and starbox-the authox box for humans plugins installed. When I click the author link on the starbox author box, it goes to the author archive. But I want to take visitors to authors’ buddypress profiles.

    So I want to redirect every request from (let’s say)
    https://www.mysite.com/author/username
    to
    https://www.mysite.com/members/username

    Is it doable? How?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Yanur Islam Piash

    (@yipiash)

    Okay I did this way and it worked. Thanks to Buddydev

    Redirect Author Archive Page to BuddyPress User Profile

    function buddydev_author_redirect_to_profile() {
    
        if ( is_author() && function_exists( 'bp_core_redirect' ) ) {
    
            $author_id = get_queried_object_id();
            bp_core_redirect( bp_core_get_user_domain( $author_id ) );
        }
    }
    add_action( 'template_redirect', 'buddydev_author_redirect_to_profile' );
    Thread Starter Yanur Islam Piash

    (@yipiash)

    add this snippet to your theme’s functions.php file or bp-custom.php file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect when an URL contains a specific slug’ is closed to new replies.