1

I have a front end client portal I created when a user logs in they are redirected to a page called "Dashboard". The pages displays recent projects, invoices, and recent messages.

Recent messages displays comments of all comments posted by a current user. What I would like to do is also display comments when someone replies to the comment or post a comment in their assigned project.

Example

Designer A (user administrator) leaves a comment for Project 1 for Client 1.

When Client 1 signs into the portal he will see Designers A comment in the recent message field.

Once Client 1 leaves a comment they can see their comment in the recent message feed along side Designer A comment.

As of right now I am able to display all post based on the user who logs in thanks to this post https://stackoverflow.com/questions/11009734/how-to-display-loged-in-users-comments-only-on-wordpress.

Example

-Client logs in and will be able to see all their comments plus comments that are associated with them. (meaning when a designer leaves a comment on their post)

-Administrator can see all comments in their feed

 <?php
        if ( is_user_logged_in() ) {
        $user_id = get_current_user_id();
        $args = array(
           'status' => 'approve',
           'order' =>  'DESC',
           'user_id' => $user_id
);
  $comments = get_comments($args);
  foreach($comments as $comment) :
    echo '<p>'; 
    echo($comment->comment_author . '<br />' . $comment->comment_content);
    echo '</p>';
 endforeach;
 }
 ?>
  • 1
    Have you searched the site and taken a look to the right hand side to the related questions ? Like this one? Also it's unclear where exactly (and in which context) you want this to happen. – kaiser Nov 19 '14 at 17:00
  • Yes I have I have been looking for awhile. I like to solve things on my own before I come to this website. But I have not been able to find what I have been looking for. Everything should be displayed on the front end of the portal not in the backend @kaiser – user3756781 Nov 19 '14 at 17:04
  • What has been your research so far? Sharing your research helps everyone. Tell us what you found and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and above all, it helps you get a more specific and relevant answer. More info about how to ask a good question can be found on the How to Ask page. – kaiser Nov 20 '14 at 0:30
  • I just updated my post @kaiser – user3756781 Nov 20 '14 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.