Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

nate22 on "Simplest way to get ONE category title when post has multiple categories?"

$
0
0

What's the simplest way to spit out a single category as a title in an H2 tag for a post with multiple categories? The forums and codex seem full of a lot of not-so-great options that involve writing a bunch of conditionals for different category IDs...which means it's almost hard-coded since you need to consider all the ID # s and update it whenever there's a new category added. Which is dumb. Seems like there should be a much simpler method to just store the category array in a session variable. Do I actually have to get all tricky and invent some session variable or something that WP doesn't already have?


Viewing all articles
Browse latest Browse all 8245

Trending Articles