get only parent category wordpress code example
Example: wordpress show only parent category
$args = array(
'orderby' => 'name',
'order' => 'ASC',
'parent' => 0
);
$categories = get_categories($args);
$args = array(
'orderby' => 'name',
'order' => 'ASC',
'parent' => 0
);
$categories = get_categories($args);