Skip to:
Content
Pages
Categories
Search
Top
Bottom

Anonymous Profile in Tool Bar

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

  • Robin W
    Moderator

    @robin-w

    the bbpress theme that this site uses is here

    https://meta.trac.wordpress.org/browser/sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base

    the following file holds the code

    https://meta.trac.wordpress.org/browser/sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/header-subnav.php

    but you will also need to pull through some css from the theme, and JavaScript to do the drop downs

    then tie all this back to the right place in your theme.

    It’s quite doable, but well beyond free help


    Pete
    Participant

    @uniquepete

    Thanks @robin-w. This (the inclusion of the anonymous user bit) is not just a case of specifying some configuration option on the admin-bar then?

    Is it a similar story then with the way that even the logged in user profile is presented on this site? The standard wp-admin-bar doesn’t seem to offer an option to present just the ‘bare’ username/avatar—I can’t find a way to get rid of the ‘Howdy’ or ‘G’day’ (as I get here in Australia) entirely, like this site does, to present just the username/avatar (I really can’t understand why this isn’t the standard base case). I can find all the language stuff down in wp-content/languages, but I’d really just like to turn off that ‘greeting’ stuff altogether on the admin-bar.

    Thanks again.


    Robin W
    Moderator

    @robin-w

    Haven’t tested but googled and found this

    add_filter( 'admin_bar_menu', 'replace_wordpress_howdy', 25 );
    function replace_wordpress_howdy( $wp_admin_bar ) {
    $my_account = $wp_admin_bar->get_node('my-account');
    $newtext = str_replace( 'Howdy,', 'Welcome,', $my_account->title );
    $wp_admin_bar->add_node( array(
    'id' => 'my-account',
    'title' => $newtext,
    ) );
    }

    Put this in your child theme’s function file – or use

    Code Snippets


    Pete
    Participant

    @uniquepete

    Thanks again @robin-w. Yes, I saw that one. That does work as long as the text that’s being replaced is ‘Howdy’. but that’s language dependent. Down here, if your site is configured for Australia, it’s ‘G’day’ and in other countries I imagine it’s something different again (and that code works as long as you specify the exact string that you need to replace).

    I was actually wanting to get rid of that text altogether, in a language-independent way, so I was hoping that it had a ‘name’, like ‘wp-user-greeting’ or something that you could just do a $wp_adminbar->remove_node on, but it sounds like this is not the case. Is the format of the username/avitar on the admin-bar on this site, where there’s no ‘prefix’ at all, really hard coded (rather than managed through something like a function)?

    I am making progress with the code (to identify a user as anonymous before they log in) from your previous response, so thanks again for that, but I’m modifying files that are bound to be replaced with the next WordPress/bbPress update. There must surely be some ‘version independent’ way of doing this…


    Robin W
    Moderator

    @robin-w

    that only matters if you are doing it for say a theme. there probably is another way, but that is WordPress not bbpress, so if you want to pursue, try the main WordPress forums.


    Pete
    Participant

    @uniquepete

    OK, thanks. I’m new to this game, so I hadn’t appreciated where the line between WordPress and bbPress might have been drawn. I was trying here largely becasue this website was set up the way I wanted.

    Thanks again for your help though.

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