Skip to:

Are Usernames with Spaces Sensible?

  • James Blacker


    Is it ‘done’ to choose usernames with spaces? I’m just looking at this forum homepage, and I’m the only one who has chosen one, which is also why I have a problem with links from Post to my Profile on my own discussion board, even though it works for users who have an unbroken string as a username. Obviously, looking at the URL’s it’s the space that stops it being found, but given that the system (both, in fact) allowed me to choose a username with a space, is that no reasonable? Givem that it’s functionally possible, it would be poor to say to my subscribers to not use spaces.

    Here’s the example of posts where link to my profile doesn’t work, but the link to another (non-spaced) user does;

    And here’s the change I made to the post.php code, putting in; `<a>”>

    <?php bb_get_profile_link(post_author()); ?></a>` – is this not the best/quoted way to do this?

    <div class="threadauthor">
    <?php bb_get_profile_link(post_author()); ?></a></strong>
    <small><?php post_author_title(); ?></small></p>



Viewing 2 replies - 1 through 2 (of 2 total)

  • deadlyhifi


    Usernames can have a space in them because there is also a user_nicename set. This is all lowercase and any spaces are replaced with underscores. If you look at the link to your member page here you’ll see it ending in ‘james-blacker’.

    I presume you’re wanting a link to the profile page when you click on a username.

    To do that you need to something along the lines of

    <a href="<?php user_profile_link(get_post_author_id()); ?>"><?php post_author(); ?></a>

    James Blacker


    Oh you top man Tom! Yep, worked first time, perfect.

    Over on the other forum at:

    they tried this, which didn’t quite work;

    <a href="<?php bb_get_profile_link(post_author()); ?>">
    <?php bb_get_profile_link(post_author()); ?>

    I’ll mark this thread as resolved then, and put a link to here on there. Nice one, thanks.


Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar