add_filter( 'allowed_block_types', function( $allowed ) {
global $wp_post_types, $post;
if ( 'templates/home.php' === get_page_template_slug( $post->ID ) ) {
$wp_post_types[ $post->post_type ]->template = [
[ 'oshpd/homepage-hero' ],
[ 'oshpd/latest-news' ],
[ 'oshpd/leadership-cards' ],
];
$wp_post_types[ $post->post_type ]->template_lock = 'all';
}
});
query GET_CURATED_LEADERSHIP($postIn: [ID]) {
leadership: staffMembers(
first: 3
where: {
in: $postIn
orderby: { field: IN order: ASC }
}
) {
cards: nodes {
...LeadershipCard
}
}
}
query GET_CURATED_LEADERSHIP($postIn: [ID]) {
leadership: staffMembers(
first: 3
where: {
in: $postIn
orderby: { field: IN order: ASC }
}
) {
cards: nodes {
...LeadershipCard
}
}
}
fragment LeadershipCard on StaffMember {
featuredImage {
sourceUrl
}
name: title
link
}