I'm trying to display the get_category_category limiting the results to only the child categories of parent "666".
So a post may have a number of categories e.g. "1234", "666", "666/1341", "5", "5/17" but I only want to show the child of "666".
$args = array( 'numberposts' => '5','post_status' => 'publish','category' => '1234','category__not_in' => '680', 'orderby' => 'post_date', 'order' => 'DESC' );
$recent_posts = wp_get_recent_posts($args);
{
///I want to return the category for each post in this loop that is within the "666" category.
///E.g get_the_category($recent['ID']) where the category is a child of 666
echo "POST ID" . $recent['ID'] . " CHILD CATEGORY ". $childcategory;
}
The above loop will return the last 5 posts in category "1234" with each child category of "666".
e.g.
- POST ID 10 CHILD CATEGORY 1341
- POST ID 11 CHILD CATEGORY 1341
- POST ID 14 CHILD CATEGORY 99
- POST ID 19 CHILD CATEGORY 1341
- POST ID 23 CHILD CATEGORY 99