I am trying to populate an array with a list of categories in a custom taxonomy I created.
The taxonomy, called clips, has a slug called clipcat. I only want the array to populate with children of a clip with the same slug as the page slug the list is on.
Here's my code so far:
<?php global $post; $slug = get_post( $post )->post_name; $taxes = array('clipcat'); $args = array( 'parent' => $slug, ); $categories = get_terms( $taxes, $args ); print_r($categories); ?>
To my knowledge, the code is as it should be, but when I print the array (the last line in the code), the array is empty even though I know the clip category that is successfully assigned to
$slug has three sub categories (so I must be coding something wrong).
Any suggestions to what I'm doing wrong?