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

    @robin-w

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


    Kikis
    Participant

    @temian

    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

    @robin-w

    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


    Kikis
    Participant

    @temian

    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

    @robin-w

    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

    @robin-w

    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 ;
    }

    Kikis
    Participant

    @temian

    Thanks for the help


    Robin W
    Moderator

    @robin-w

    you’re welcome


    Kikis
    Participant

    @temian

    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

    @robin-w

    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


    Kikis
    Participant

    @temian

    Thanks


    Robin W
    Moderator

    @robin-w

    🙂


    Kikis
    Participant

    @temian

    How can I get favorite count
    And subscription notification count


    Robin W
    Moderator

    @robin-w

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


    Kikis
    Participant

    @temian

    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

    @robin-w

    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)


    Kikis
    Participant

    @temian

    Thanks for your time


    Kikis
    Participant

    @temian

    I got an error why using the code


    Robin W
    Moderator

    @robin-w

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

    try again


    Kikis
    Participant

    @temian

    Now it’s works perfectly thanks


    Kikis
    Participant

    @temian

    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


    Kikis
    Participant

    @temian

    I got this error on the front-page


    Kikis
    Participant

    @temian

    I was able to solve it


    Robin W
    Moderator

    @robin-w

    great

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