Get Categories For Current Post
I wanted a function that returned the categories associated with the current post to save screen real estate. I wanted it to be a drop-down with a JavaScript onchange, but I couldn’t find it anywhere. After some hacking I finally worked out a function. Place the following code in your current theme’s functions.php file (if you don’t have one then create it).
Anywhere you want this to show up put this function in the loop or a single post page.
Post Meta
- June 18, 2007
- PHP, Tutorials, WordPress
- Comments Below
- 125 Words
No Comments (So Say Something)