Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
611 views
in Themes by
closed by

You can use an advanced theme for that (file qa-theme.php) and override as follows:

    function post_meta_who($post, $class)
    {
        if(isset($post['who']))
        {
            // replace username with real name from userprofile
            if(isset($post['raw']['handle']) && isset($post['raw']['userid']))
            {
                require_once QA_INCLUDE_DIR.'qa-db-metas.php';
                $userhandle = $post['raw']['handle'];
                $userid = $post['raw']['userid'];
                $htmluserlink = $post['who']['data']; // in tag is userhandle
                // get real name from userprofile field
                $realname = $this->qa_db_user_profile_get($userid, 'name');
                if(!empty($realname))
                {
                    $post['who']['data'] = str_replace('>'.$userhandle.'<', '>'.$realname.'<', $htmluserlink);                  
                }
            }

        
            $this->output('<span class="'.$class.'-who">');
            
            if (strlen(@$post['who']['prefix']))
                $this->output('<span class="'.$class.'-who-pad">'.$post['who']['prefix'].'</span>');
            
            if (isset($post['who']['data']))
                $this->output('<span class="'.$class.'-who-data">'.$post['who']['data'].'</span>');
            
            if (isset($post['who']['points']))
            {
                $post['who']['points']['prefix']='('.$post['who']['points']['prefix'];
                $post['who']['points']['suffix'].=')';
                $this->output_split($post['who']['points'], $class.'-who-points');
            }
            
            if (strlen(@$post['who']['suffix']))
            {
                $this->output('<span class="'.$class.'-who-pad">'.$post['who']['suffix'].'</span>');                    
            }

            $this->output('</span>');
        }
    } // END post_meta_who

 

Q2A version: 1.7
closed with the note: tips
by
does not work. When applying the patch, donut theme only displays 1 post.
...