Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can i display bbpress user full name in my header

Viewing 24 replies - 1 through 24 (of 24 total)
  • @robin-w

    Moderator

    can you post a ink to your site and say precisely where you would like this please

    @temian

    Participant

    This is the link to my site bbnaijaforum.com

    I want to display the name after the good morning greeting in the header

    Good morning, Praise John

    @robin-w

    Moderator

    ok, so not sure how this page is created, can you tell me how you did

    Our 2 users have created 4 topics with 7 replies.

    that will tell me how best to help you

    @temian

    Participant

    add_shortcode (‘kiki-stats’ , ‘kiki_show_stats’ ) ;

    function kiki_show_stats() {
    $user_count = count_users();
    $users = $user_count[‘total_users’] ;
    $topic_count = wp_count_posts(‘topic’);
    $topics = $topic_count->publish;
    $reply_count = wp_count_posts(‘reply’);
    $replies = $reply_count->publish ;
    $text = ‘Our ‘.$users.’ users have created ‘.$topics. ‘ topics with ‘.$replies.’ replies.’ ;
    echo $text ;
    }

    @robin-w

    Moderator

    ah, sorry forgot that I had done that for you !

    add_shortcode ('kiki-greet' , 'kiki_greet' ) ;
    
    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo $user->display_name ;
    }

    and [kiki-greet]

    @robin-w

    Moderator

    or this for full name

    add_shortcode ('kiki-greet' , 'kiki_greet' ) ;
    
    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo $user->first_name.' '.$user->last_name ;
    }

    @temian

    Participant

    Thanks for the help

    @robin-w

    Moderator

    you’re welcome

    @temian

    Participant

    I’m trying to display topic in list form

    Like this website nairaland.com

    If you check all the forum categories you will notice all topics are in list form

    Is there a way to achieve this on bbpress

    @robin-w

    Moderator

    ok, we are not a website design site.

    Each forum is a page, and a page has a url, which is how to link to it.

    You just need to learn how to create links, and send users to the url that is the forum page you want thme to go to

    plenty of places to learn how to do that if you google

    eg

    https://openclassrooms.com/en/courses/2479876-build-your-website-with-html5-and-css3/2490386-creating-links

    @temian

    Participant

    Thanks

    @robin-w

    Moderator

    🙂

    @temian

    Participant

    How can I get favorite count
    And subscription notification count

    @robin-w

    Moderator

    sorry, this is into web design and beyond help in a support forum

    @temian

    Participant

    I’m trying to add css tag to this code but could not

    add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;

    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo $user->display_name ;
    }

    I want to style the name

    @robin-w

    Moderator

    wrap it in some <div>‘s

    add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;
    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo '<div="kiki-greet">.$user->display_name.'</div> ;
    }

    then style the div name (which can be anything unique – I just called it kiki-greet)

    @temian

    Participant

    Thanks for your time

    @temian

    Participant

    I got an error why using the code

    @robin-w

    Moderator
    add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;
    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo '<div="kiki-greet">'.$user->display_name.'</div>' ;
    }

    try again

    @temian

    Participant

    Now it’s works perfectly thanks

    @temian

    Participant

    home4/temian1/public_html/wp-content/themes/Tribe/functions.php on line 4

    Warning: A non-numeric value encountered in /home4/temian1/public_html/wp-content/themes/Tribe/functions.php on line 4

    @temian

    Participant

    I got this error on the front-page

    @temian

    Participant

    I was able to solve it

    @robin-w

    Moderator

    great

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