Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
2.4k views
in Q2A Core by
I want to show login user total points after his name into the header. Can anyone please tell me how can I do that?

1 Answer

+4 votes
by
selected by
 
Best answer

Put this in your qa-theme.php file:

        function logged_in()
        {
            $this->content['loggedin']['suffix'] = @$this->content['loggedin']['suffix'].' ('.qa_lang_html_sub('main/x_points',number_format(qa_get_logged_in_points())).')' ;
            
            $this->output_split(@$this->content['loggedin'], 'qa-logged-in', 'DIV');
        }

by
Yes this is fantastic but can you please know me if I want only points code which I can put anywhere I want. Now its automatically placing to the header user area. But if I want it somewhere else only points
by
Yes, of course, it can be modified to suit the need.
by
But how to get? I mean which code I should use from this only to display point wherever I want?
by
the function to get logged in points is qa_get_logged_in_points()
by
I am getting points but I want to remove now user name with that.. how to do that? I just only want Points number nothing else.
by
I am using a Pixel_n_Grain_Light_V_L1.1 theme and I Put your function at qa-theme.php file but it is not working.
by
I have already tested on the same day of the answer and it is working completely fine with the theme. Can you please tell me where you are adding this function in theme file? or tell me the location where you want than may be I can help you. If you want it into the header than you must have to place this function between theme header tags. I will give you entire code for header tonight now I am outside.
by
thanks for the reply, its working now. I have forget to put the code inside the class qa_html_theme extends qa_html_theme_base
by
glad to hear :)
by
Sir, when I open my homepage without login it shows as (0 point) can i remove this.
by
May be NoahY will help you or i will get back to you as soon as I will check.
...