Home Forums Front-end Issues Custom post with ACF & posts


Custom post with ACF & posts

  • Hi,

    I have a tricky one which I’m hoping someone can help with.

    I have custom posts for staff profiles and inside there I have ACF for name, email etc. I have added user_connection & user fields as I want to assign the user to the staff profile.

    What I am trying to do is under each output on the front end is the staff details (done) and 3 recent posts they’ve published but not been able to do that?

    Can anyone assist please?


  • you need to do a query for the posts

    $args = array(
      'post_type' => 'post',
      'posts_per_page' => 3,
      'author' => $user_id // set to the user ID you want posts for
    $query = new_WP_Query($args);
    // then loop through posts and display

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.