WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Get ID of parent category

[Resolved] Get ID of parent category

  • I’m trying to get the parent ID of a category. I’ve searched around but the only things I can find on this get the top level parent ID not the direct parent of the current page ID.

    I have 3 layers of category:

    -cat 1
    ——-cat 2
    ————-cat 3

    cat 3 is a child of cat 2, cat 2 is a child of cat 1.

    If I’m currently on the cat 3 page how can I get the ID of the category directly above it? (cat 2)

    Appreciate any help!

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Get ID of parent category’ is closed to new replies.