How to List Categories and Vary -y and -ies Suffixes?
-
Hi everyone. Here’s what I’m trying to do, I’d be very grateful if you can help me:
I want to include a sentence under each of my posts that says “If you enjoyed this post, read more like it in the [category name(s)] category OR categories.
Here are the things that would vary: if there’s one category, the sentence should read “in the BLANK categorY. If there are two categories, it should say “in the BLANK & BLANK categorIES. If there are more than two categories, it should say “in the BLANK , BLANK & BLANK categorIES.
So the -y and -ies categor- suffixes would change depending on the number of categories. And a comma would be added between categories (except the last one, which would take an &) if there were more than two categories.
I’d imagine there’s a way to do this with PHP, but how? Thanks a ton in advance.
-
Ocano
Are you on wp.com or self-hosted?
if you’re on wp.com there’s no way to do this automatically, it’s a manual insert.
If you’re self-hosted there are plugins already available to do this. Unfortunately you’re at the wrong forum. You need to be at http://www.wordpress.org.
HTH
Collin
-
Oh my, I’m in the wrong place!
Started a post at .org and I’m resolving this now. Thanks :)
- The topic ‘How to List Categories and Vary -y and -ies Suffixes?’ is closed to new replies.