Skip to content
Advertisement

WP Get IDs of parent categories only

The snippet below works fine but I’ve hard coded the parent categories IDs, Now I’m looking for a way to get rid of hard coded IDs.

JavaScript

Advertisement

Answer

If 0 is passed, only top-level terms are returned.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement