• Resolved Gustav

    (@4ever16)


    This code shows user description in forum post under the avatar.

    add_action('asgarosforum_after_post_author', 'my_function_asgaros_cabinet', 10, 1);
    function my_function_asgaros_cabinet($author_id) {
      $userData = get_userdata($author_id);
    
      if (!empty($userData) && !empty($userData->description)) {
    	echo '<span style="font-size:8px !important;">'.$userData->description.'</span>';
      }
    }

    How do i do the same thing but in the widget instead. Recent topis from forum widget.

Viewing 1 replies (of 1 total)
  • Thread Starter Gustav

    (@4ever16)

    Solved it.

    forum-widgets.php

    $author_id = $element->author_id;
    $display_name = get_the_author_meta( 'description' , $author_id ); 
                        if ($avatars_available && $show_avatar) {
                            echo '<div class="widget-avatar">'.get_avatar($element->author_id, $widgetAvatarSize).'</div>';
    						echo $display_name;
                        }

    echo $display_name; should maybe look different for you!

Viewing 1 replies (of 1 total)

The topic ‘Show user description in widget’ is closed to new replies.