author -> bbp_user

  • Anonymous

    #5017

    Is there a way to replace calls for a user’s author page by calls to the bbp_user page or to link the author page to the bbp_user page? To be precise–if a link directs me to …/?author=n, I want it to go to …/?bbp_user=n

    Anonymous

    #30305

    Elsewhere someone told me:

    You could use htaccess and a RewriteRule for that.

    Can someone help me figure out what that means and how to do it?

    Thanks!

    Martin

    Admin

    Syahir Hakim

    #30306

    Try adding this to your child theme’s functions.php file:

    function graphene_redirect_author_page(){
    if ( ! is_author() ) return;

    wp_redirect( get_user_profile_link( get_the_author_meta( 'ID' ) ) );
    }
    add_action( 'template_redirect', 'graphene_redirect_author_page' )

    Anonymous

    #30307

    Syahir,

    Thank you–I guess I have to learn about child themes, etc. For a quick fix, where do you recommend I start?

    Just to make sure, does this replace …/?author=n, with …/?bbp_user=n or with …/?uid=n or is this a general function that can redirect to anything that I like?

    Thanks!

    Martin

    Admin

    Syahir Hakim

    #30308
    Quote:
    Thank you–I guess I have to learn about child themes, etc. For a quick fix, where do you recommend I start?

    No quick fix, you will need to have a child theme to implement this. See this page on how to create a child theme. It’s not that difficult.

    Quote:
    Just to make sure, does this replace …/?author=n, with …/?bbp_user=n or with …/?uid=n or is this a general function that can redirect to anything that I like?

    It redirects all WordPress author profile page to the bbPress profile page.

    Anonymous

    #30309

    Thank you! Can I use the one-click child theme plugin? Here is the description: plugin website I don’t have direct access to the directories where everything is installed (I didn’t set up the installation, I am just helping out with making it work), so I basically need to do things with various admin tools.

    Hmm. Reading the comments is worrying–lots of problems with it, so i’m going to wait for advice before installing it. All advice much appreciated!

    Martin

    Anonymous

    #30310

    I tried using the instructions here: child-theme-template. I unzipped the file,

    put the code above (cutting and pasting–are all the spaces and linebreaks displayed correctly?) into the functions.php file, rezipped it, and uploaded it. The code was displayed at the top of the page, and in addition to losing all the formatting and uploaded pictures, widgets, etc., it didn’t work. Fortunately, I reinstalled the graphene theme, imported the options that I had saved, and I’m back where I started. Any suggestions? Thanks!

    Martin

    Admin

    Syahir Hakim

    #30311
    Quote:
    I unzipped the file,

    put the code above (cutting and pasting–are all the spaces and linebreaks displayed correctly?) into the functions.php file, rezipped it, and uploaded it. The code was displayed at the top of the page,

    It’s a PHP file, so you need to start the file with <?php and end it with ?>.

    Quote:
    and in addition to losing all the formatting and uploaded pictures, widgets, etc.,

    Changing to a child theme is similar with changing to another theme, so WordPress reset your navigation menu assignment, custom background, and custom header. You’ll need to set them again, but other than that, the rest should be the same.

    Admin

    Syahir Hakim

    #30312
    Quote:
    I don’t have direct access to the directories where everything is installed (I didn’t set up the installation, I am just helping out with making it work), so I basically need to do things with various admin tools.

    That makes it very difficult to do things. Can’t you push the site’s owner for at least FTP access to the themes directory?

    Anonymous

    #30313

    I am trying it again with an extra line with <?php at the beginning and an extra line with ?> at the end–is that the right way to do it?

    Is there anyway to use the exported graphene-options file to restore things?

    Thanks!

    Martin

Viewing 10 posts - 1 through 10 (of 25 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!