Support » Plugins » How to choose the first letter of the Last word when sorting alphabetically

  • Hi…

    I’m using WordPress as a CMS for an agency website, where I’m using categories titled with people’s names to collate seperate posts about them. So there might be a category called Bob Dylan, which pulls up news, works, and a biog from other categories.

    I’m using wp_list_cats to present a simple list of all these people. This orders the categories by name, alphabetically by default. That’s fine, but I’d like to be able to sort by surname instead- ie. using ‘Dylan’ instead of ‘Bob’.

    So I presume I’ll need to use some kinda string manipulation to find the last seperate¬†word in a category title, and use the first letter of that word to determine the alphabetical order, rather than the first letter of the entire string.

    Unfortunately I’m at a loss with where to start with scripting something like this, and I’ve not been able to find anything similar to guide me.

    Any nudges in the right direction would be extremely helpful…

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to choose the first letter of the Last word when sorting alphabetically’ is closed to new replies.