• Resolved respectyoda

    (@respectyoda)


    I am currently dealing with a challenging problem. Let me explain briefly some information before I explain what my problem is.

    On the homepage, it lists 9 students chosen from a list of students stored in a custom post type called ‘students’ that I created. Now, each student has a login name which is basically the same as the author name. There’s a link below each student saying, “Read {student name}’s story” and this brings one to a page that lists the content for that student that was created in the students (custom post type) section.

    The challenge is that I want to show all the posts by that author/student on the page detailing the info about that specific student. For example, on the homepage, it shows a picture of John Doe and below that picture is the link saying, “Read John Doe’s Story”. Now when I click on that link, I am brought to a page with the content of “Jane Doe” page of the custom post type of student. Then below the content should be all posts made by John Doe.

    I began doing this by making a link between the students custom post type and the author name. I created the link by making a custom meta box for the students custom post type that lets the admin type the student’s actual username or author name and save it. Now, when I use php code to echo the author name from that field, it does show up. I need help on using this value to retrieve and show all posts by that author/student/username.

    Any help/insight is welcome.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Get Posts By Author Name’ is closed to new replies.