• Resolved audiofoundry

    (@audiofoundry)


    Hi there!

    At the top right of the comment form, a user is presented with:

    You are logged in as username

    By default, that link leads to the destination of:

    https://www.website.com/author/username/

    On sites that do not have author pages for general users, this is a deadlink and is therefore broken. I have looked through the wpDiscuz menus but unfortunately cannot find the right way to change this.

    Please could you advise me as to how to change this hook to point at:

    https://www.website.com/profile/

    Thank you for any help you can offer with this!

    • This topic was modified 2 years, 8 months ago by audiofoundry.
    • This topic was modified 2 years, 8 months ago by audiofoundry.
Viewing 3 replies - 1 through 3 (of 3 total)
  • It’s unlikely the wpDiscuz can discover the method your site uses to disable author pages in a generic way.

    As a workaround, you can add a redirection with a regular expression, either directly in your .htaccess file, via a plugin, like Redirection, or with PHP code (see here).

    • This reply was modified 2 years, 8 months ago by Gal Baras.
    Plugin Support gVectors Support

    (@gvectorssupport)

    Hello,

    Use the hook code below for changing the URL only for the wpDiscuz comment section:

    add_filter('wpdiscuz_profile_url', function ($profile_url, $user){
        return 'https://www.website.com/profile/';
    },145,2);

    Use the hook code below for changing the profile URL for the whole website:

    add_filter('author_link', function ($link, $author_id, $author_nicename){
        return 'https://www.website.com/profile/';
    },145,3);

    The codes should be put in the WordPress active theme functions.php file: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

    Thread Starter audiofoundry

    (@audiofoundry)

    Ahh I see! Thank you very much for those hook codes. That has solved it perfectly!

    Thank you again for your help with this!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Username Link’ is closed to new replies.