List only child categories a post is in, of a specific parent category in wordpress

I am building a quotes website and i have 2 main categories like Topic Authors
Every quote will have Author name and topic name and those are sub categories of Topic Author.
AND my question is
i want to display only Author categories that is a sub category of a Authors category please help me...

Topic
- Love
- Life
- Friends etc
Authors
- Author1
- Author2
- Author3

Topic categories Wordpress

Category Web


    <?php
        // names / IDs of parents
        $parents = array(
            'par2' => 76
        );
        // get post categories
        $categories = get_the_terms( $post->ID, 'category' );
        // output top level cats and their children
        foreach( $parents as $parent_name => $parent_id ):
        // output parent name and link
        //echo '<a href="' . get_term_link( $parent_id, 'category' ) . '">' . $parent_name . '</a>: ';
        // initialize array to hold child links
        $links = array();
        foreach( $categories as $category ):
        if( $parent_id == $category->parent ):
        // put link in array
        $links[] = '<li><a href="' . get_term_link( $category ) . '">' . $category->name . '</a></li>';
        endif;
        endforeach;
        // join and output links with separator
        echo join($links );
        endforeach;            
    ?>

This is the answer i am looking for thanks for replys


It will give you the same structure as shown above:

wp_list_categories(array('hide_empty'=>0, 'hierarchical' => true, 'include' => array('12','12')));

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.