How can i display bbpress user full name in my header
-
If any one can assist me with this
-
can you post a ink to your site and say precisely where you would like this please
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
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
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 ;
}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]
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 ; }
Thanks for the help
you’re welcome
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
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
Thanks
🙂
How can I get favorite count
And subscription notification countsorry, this is into web design and beyond help in a support forum
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
wrap it in some
<div>
‘sadd_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)
Thanks for your time
I got an error why using the code
add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ; function kiki_greet() { $user = wp_get_current_user() ; echo '<div="kiki-greet">'.$user->display_name.'</div>' ; }
try again
Now it’s works perfectly thanks
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
I got this error on the front-page
I was able to solve it
great
- You must be logged in to reply to this topic.