Query pages by child term

What do you mean by “dynamic” ? Do you want it to work with different posts?

If so, that’s simple. Before your get_posts query function, get page terms, and pass them to your array. You can get taxonomies with

 <?php get_the_terms( $yourpostid, 'your_custom_taxonomy'); ?> 

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)