Post category list manipulation
-
Hello everyone.
I’d like to apologize first-off if this has been mentioned before, but after quite a bit of searching, I haven’t found much, and I’m not good enough at coding yet to figure it out myself. Anyway, here is my problem:
In each post’s title bar, I want to have a list of categories. Simple enough, but I want there to only be one category displayed until the user put the cursor over that category, at which point the other categories are revealed next to it. You can see basically the effect I’m going for at the website Kotaku if you take a look at the single-post page for any of their posts. I’m not entirely sure how I’ll get the JavaScript to work properly with dynamically generated lists of text, but I think I can figure that out. What I’m having trouble with is how to have WordPress return a single category in one section (probably a span) and the rest in another section (probably another span). My other concern is that I only have a limit amount of horizontal space for my categories on the main page. If possible, I’d like to have either WordPress, my JavaScript, or something else, automatically truncate my list of categories and stick in either a “More…” link or just a set of ellipses. Alternatively, if I could just somehow tell WordPress to return no more than, say, two additional categories, that would also be acceptable.
If anyone has any suggestions on how to implement any of these things, I would be very, very thankful.
Thanks in advance for any help.
-Ben
The topic ‘Post category list manipulation’ is closed to new replies.