I’m using the following to list all sub pages of the current page. I want to use wp_get_post_terms to filter these sub pages by custom taxomony term.
Current page
– taxonomy 1 title
– – sub page 1
– – sub page 2
– taxonomy 2 title
– – sub page 1
– – sub page 2
$mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) );
foreach( $mypages as $page ) {
$content = $page->post_content;
if ( ! $content )
continue;
echo "<h2><?php echo $page->post_title; ?></h2>";
}
Can anyone help please?