最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

author - Create Next and Previous Link to User orderby Last Name

matteradmin6PV0评论

Within author.php, I have a left and right arrow that is supposed to move to the NEXT or PREVIOUS user orderby based on last_name.

So if I had users with these names:

  1. Julie Brown
  2. Jane Cook
  3. John Doe
  4. Jack Eagle
  5. Jason Fox

So if I'm looking at John Doe's author.php, the next button would automatically link to Jack Eagle for example. And the previous button would automatically link to Jane Cook. THis would be alphabetical based on lastname.

Does anyone know how I can code the left and right arrows to do that.

I'm trying to display a list of authors by their last name. I can get the list to display but as yet I don't seem to be able to order the list by last name. Any help would be greatly appreciated. Josh

I found a thread that orders users by last_name, but I don't know how to use it within author.php to create a Next / Previous button to correctly go to the next user ordered by last_name.

Thread I found has part of the answer: Ordering users of a specific role by last name

Post a comment

comment list (0)

  1. No comments so far