BuddyDev

Redirect Author Archive Page to BuddyPress User Profile

This is old code. Please see this link for better example

If you have enabled BuddyPress and want to redirect to user's profile when someone tries to access the author archive page, you can use the following code.

Isn't that a sweet little hack 🙂

4 Responses to Redirect Author Archive Page to BuddyPress User Profile

  • which file should be edited?

    • Hi Yaser,
      You can put it in your theme's functions.php or in wp-content/plugins/bp-custom.php

  • I'm wondering why the use of "function_exists( 'bp_core_redirect' )" if it's not being used and you are redirecting on "template_redirect".

    Any reason? o.O

    • Hi Renato,
      Please see the condition inside the if block.

      1. the bp_core_redirect is being used.
      2. I am using that for 2 purposes.
      a) It is a BuddyPress function, so It guarantees that BuddyPress is enabled and
      b) I don't have to call exit after wp_redirect.

      Hope that clarifies.