Who's Online
[resolved] Directory location for user profiles??? (4 posts)

  1. MasterZonk
    Posted 3 years ago #

    Is there a way to change the links of the online user icons? When you click on the online icons its looking in "http://website.com/author/username" My user profiles are located in of "http://website.com/user/username"

    Maybe I'm missing something???


  2. Annika Backstrom
    Plugin Author

    Posted 3 years ago #

    I've bumped the plugin to version 0.6, adding a filter wpwhosonline_author_link to allow for customization of this link. By default, it uses get_author_posts_url().

    You can add something like this in a plugin or your theme's functions.php:

    function mytheme_whosonline_link( $link, $user ) {
        return '<a href="/user/' . $user->user_login . '">' . esc_html( $user->display_name ) . '</a>';
    add_filter( 'whosonline_author_link', 'mytheme_whosonline_link', 10, 2 );
  3. rabbitshavefangs
    Posted 3 years ago #

    I'm sorry but I'm not understanding how to implement this. I've tried a few things and simply screwed up my site. I luckily had saved the old code and reverted back.

    Where do I go from here? Most of my users don't have POSTS, in fact I don't know many blogs that do. A more useful function would be the ability to view someone's profile when clicking their name, preferably only by logged in users to protect privacy.

    Thoughts? Help?

    Thank you!

  4. Annika Backstrom
    Plugin Author

    Posted 3 years ago #

    I assume it's pretty common in P2 blogs for teams, where the whole point is that any user can create a post. That aside, the idea of a "profile" is different from blog to blog, particularly if you're using something like bbPress.

    The code sample I included above should work in your theme's functions.php, though it's hard to prescribe a "best" location. If you want to try adding it somewhere and reply again with your specific error, I can help you debug the issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Who's Online
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic