You can get an array of pages using get_pages()
and then for each page retrieve categories using wp_get_object_terms
. Your code may look like this:
$args = array(
'post_type' => 'board-meeting',
'post_status' => 'publish'
);
$pages = get_pages($args);
if ( ! empty( $pages ) ) {
echo '<ul>';
foreach($pages as $page){
$cats = wp_get_object_terms( $page->ID, 'category' ); // Array of categories
$cat="";
if ( ! empty( $cats ) ) {
if ( ! is_wp_error( $cats ) ) {
$cat = $cats[0]->slug; // slug of 1st category in the array $cats
}
// slug of category used as CSS class name for anchor tag
echo '<li><a class=". $cat." href="' . get_permalink($page-ID) . '">' . esc_html( $page->post_title ) . '</a></li>';
}
}
echo '</ul>';
}
You may adjust the code to your needs.
I hope this helps.