---
description: https://developer.wordpress.org/reference/functions/get_term_children/
---

# get child taxonomy wordpress (ok)

C:\xampp\htdocs\wordpress\wp-content\themes\twentytwentyone\header.php

```
<?php
				$term_id = 33;
				$taxonomy_name = 'genre';
				$termchildren = get_term_children( $term_id, $taxonomy_name );
				echo '<ul>';
				foreach ( $termchildren as $child ) {
			    $term = get_term_by( 'id', $child, $taxonomy_name );
			    echo '<li><a href="' . get_term_link( $child, $taxonomy_name ) . '">' . $term->name . '</a></li>';
				}
				echo '</ul>';
				?> 
```

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWPtKFbhw0XehxVuoiZ%2F-MPgHTtMOcwqx88YwzrZ%2F-MPgHdwStMhn712r_FD6%2FScreenshot_4.jpg?alt=media\&token=0990cddc-8e94-48fd-9d5a-0ebc9afc6ac1)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWPtKFbhw0XehxVuoiZ%2F-MPgHTtMOcwqx88YwzrZ%2F-MPgHiq9OBzfPwEhnTwx%2FScreenshot_5.jpg?alt=media\&token=05c07de3-190a-4764-9deb-5239ba00ad5e)
