• Okay, I’ve been trying to do this for a while now with no success.

    If I do
    $category = get_the_category();

    inside of a subcategory and then do

    $category[0]->description

    This should return the description of the CURRENT category correct? It seems that WordPress is organizing parent/child category relationships alphabetically for me, which seems really silly. Has anyone else noticed this?

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter creativelifeform

    (@creativelifeform)

    Hmm okay for anyone else having this problem, dolphin_design provided an answer in another thread I was posting in. You can just use

    if(in_category('Your Category)){}

    although this is kind of lame because it relies on you hardcoding in the sub category name. If anyone else finds a way to do this and bypass the alphabetical ordering of parent/child arrays please let me know. Can’t really understand why it is done that way in the first place though.

Viewing 1 replies (of 1 total)
  • The topic ‘Get the current category reliably’ is closed to new replies.