• Resolved qnkov

    (@qnkov)


    Hi, you have tabs with threads and comments, but there is no counter to see how many posts or comments you have added. Can you add such counter there or something? – https://prnt.sc/26n25am

    • This topic was modified 2 years, 7 months ago by qnkov.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support mansurahamed

    (@mansurahamed)

    Hi @qnkov,

    Yes absolutely. You can customize those templates and add the counter in the place that you want. Go to plugin folder ultimate-member->templates->profile where you will see the template file used for those tabs. It’s possible to override changed templated through child theme so that plugin/theme update won’t be able to remove your changes. Please follow this documentation for that

    https://docs.ultimatemember.com/article/1516-templates-map

    Thanks.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

    Thread Starter qnkov

    (@qnkov)

    @mansurahamed
    @champsupertramp

    Hi, i’ve reached that folder, but i don’t know how to add the counter? Do i need to do it manualy by adding a code to those files? Or everything is done by the settings inside the plugin?

    • This reply was modified 2 years, 1 month ago by qnkov.
    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @qnkov

    Please try this code snippet to add the Comment count in the Comments tab.

    add_filter("um_profile_tabs", "um_072522_add_comment_count", 10 );
    function um_072522_add_comment_count( $tabs ){
       
       if( isset( $tabs['comments'] ) ){ 
          $args = array(
              'user_id' => um_profile_id(),   // Use user_id.
              'count'   => true // Return only the count.
          );
          $comments_count = get_comments( $args );
          $tabs['comments']['notifier'] = $comments_count;
       }
       return $tabs;
    }

    You can add the code to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can you add comment’s counter in profile’s tab?’ is closed to new replies.