Forums

How to get all categories that have childrens? (1 post)

  1. eben0
    Member
    Posted 1 year ago #

    what is the best way?

    do i have to do custom loop, or can achieve this by doing multiple loops around the object, but this gonna effect the performance.

    now i have this:

    $scats = get_categoires();
    foreach($scats as $scat) {
    	if (!$scat->category_parent) {
    		// do stuff
    	}
    }

    but i need to filter duplicates categories assigned to the same parent.

Topic Closed

This topic has been closed to new replies.

About this Topic