Get the top level category from any category in Wordpress

/ Published in: PHP
Save to your folder(s)

Just insert any category id into the argument and it will return the top level category object.

e.g: print_r( get_top_level_category('INSERT CATEGORY ID HERE') );

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.