WordPress.org

Support

Support » Plugins and Hacks » Hacks » How display the second last child category

How display the second last child category

  • I’ve looked everywhere and I can find how to display (linked) the first and last category (in a hierarchy), but I can’t find a way how to display the second last child category.

    Any help greatly appreciated.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    @bcworkz

    If you can get the last child category object, it’s parent’s ID (and the second to last category) is available in ‘category_parent’. Do something like this if the last category object is $last_cat:
    get_category_link( $last_cat->category_parent );

Viewing 1 replies (of 1 total)
  • The topic ‘How display the second last child category’ is closed to new replies.
Skip to toolbar