Uncategorised

SCRATCH functions.php dump

By MukhtarAashury·22 August 2026·5 min read
<?php
/**
 * Template Name: Meet Our Team
 */
if ( ! defined( 'ABSPATH' ) ) exit;
get_header();

$all_members = get_posts( array(
	'post_type'      => 'team_member',
	'posts_per_page' => -1,
	'orderby'        => 'menu_order title',
	'order'          => 'ASC',
	'post_status'    => 'publish',
) );

$groups = array( 'board' => array(), 'leadership' => array(), 'steering' => array() );
foreach ( $all_members as $m ) {
	$g = get_post_meta( $m->ID, 'team_group', true );
	if ( ! isset( $groups[ $g ] ) ) $g = 'leadership';
	$groups[ $g ][] = $m;
}

if ( ! function_exists( 'apnor_render_member_card' ) ) {
	function apnor_render_member_card( $m, $extra_class = '' ) {
		$role  = get_post_meta( $m->ID, 'team_role', true );
		$email = get_post_meta( $m->ID, 'team_email', true );
		$color = get_post_meta( $m->ID, 'team_color', true ) ?: 'crimson';
		list( $c, $c2 ) = apnor_team_color_pair( $color );
		?>
		<div class="member glass reveal <?php echo esc_attr( $extra_class ); ?>" style="--c:<?php echo esc_attr( $c ); ?>;--c2:<?php echo esc_attr( $c2 ); ?>">
			<div class="m-media">
				<?php if ( has_post_thumbnail( $m->ID ) ) : ?>
					<?php echo get_the_post_thumbnail( $m->ID, 'thumbnail' ); ?>
				<?php else : ?>
					<span><?php echo esc_html( apnor_initials( $m->post_title ) ); ?></span>
				<?php endif; ?>
			</div>
			<h4><?php echo esc_html( $m->post_title ); ?></h4>
			<?php if ( $role ) : ?><p class="m-role"><?php echo esc_html( $role ); ?></p><?php endif; ?>
			<?php if ( $email ) : ?>
				<a class="m-email" href="mailto:<?php echo esc_attr( $email ); ?>"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16v16H4z"/><path d="M22 6l-10 7L2 6"/></svg><?php echo esc_html( $email ); ?></a>
			<?php endif; ?>
		</div>
		<?php
	}
}

if ( ! function_exists( 'apnor_render_steering_card' ) ) {
	function apnor_render_steering_card( $m ) {
		$country = get_post_meta( $m->ID, 'team_country', true );
		$color   = get_post_meta( $m->ID, 'team_color', true ) ?: 'crimson';
		list( $c ) = apnor_team_color_pair( $color );
		?>
		<div class="steer-card glass" style="--c:<?php echo esc_attr( $c ); ?>">
			<div class="sc-flag"><?php echo esc_html( apnor_initials( $m->post_title ) ); ?></div>
			<div><h5><?php echo esc_html( $m->post_title ); ?></h5><?php if ( $country ) : ?><span><?php echo esc_html( $country ); ?></span><?php endif; ?></div>
		</div>
		<?php
	}
}

$apnor_delay_classes = array( '', 'd1', 'd2' );
?>

<section class="page-hero">
  <div class="container">
    <div class="breadcrumb"><a href="/">Home</a><span>/</span>Who We Are<span>/</span>Meet Our Team</div>
    <span class="eyebrow">Who we are</span>
    <h1><?php the_title(); ?></h1>
    <p><?php the_content(); ?></p>
  </div>
</section>

<?php if ( ! empty( $groups['board'] ) ) : ?>
<!-- BOARD -->
<section>
  <div class="container">
    <div class="center-head reveal" style="text-align:left">
      <span class="eyebrow">Governance</span>
      <h2 class="section-title">Board of Directors</h2>
    </div>
    <div class="team-grid" style="margin-top:36px">
      <?php foreach ( $groups['board'] as $i => $m ) apnor_render_member_card( $m, $apnor_delay_classes[ $i % 3 ] ); ?>
    </div>
  </div>
</section>
<?php endif; ?>

<?php if ( ! empty( $groups['leadership'] ) ) : ?>
<!-- LEADERSHIP -->
<section style="padding-top:0">
  <div class="container">
    <div class="center-head reveal" style="text-align:left">
      <span class="eyebrow">Day to day</span>
      <h2 class="section-title">Leadership Team</h2>
    </div>
    <div class="team-grid" style="margin-top:36px">
      <?php foreach ( $groups['leadership'] as $i => $m ) apnor_render_member_card( $m, $apnor_delay_classes[ $i % 3 ] ); ?>
    </div>
  </div>
</section>
<?php endif; ?>

<?php if ( ! empty( $groups['steering'] ) ) : ?>
<!-- STEERING COMMITTEE -->
<section style="padding-top:0">
  <div class="container">
    <div class="center-head reveal" style="text-align:left">
      <span class="eyebrow">Regional voices</span>
      <h2 class="section-title">Our Steering Committee</h2>
      <p class="section-lead">The steering group helps establish our strategic goals each quarter, stays across external deadlines and the wider context, and monitors working group progress and wins — for instance, already the Australian International Development Network has signed up to the refugee leadership participation pledge. Small statements of intent like this are worth noting.</p>
    </div>
    <div class="steering-grid reveal d1" style="margin-top:32px">
      <?php foreach ( $groups['steering'] as $m ) apnor_render_steering_card( $m ); ?>
    </div>
  </div>
</section>
<?php endif; ?>

<section class="mini-cta" style="padding-top:0">
  <div class="container">
    <div class="glass reveal">
      <h2>Governed by clear policy</h2>
      <p>Our Child Protection, Partnership, Financial Management, Anti-Fraud, and Assessment &amp; Payment policies guide every part of how APNOR and the RLA operate.</p>
      <div class="btns">
        <a href="<?php echo esc_url( apnor_media_url('apnor-policies-and-procedures.pdf') ); ?>" class="btn btn-navy" target="_blank" rel="noopener">Read our policies &amp; procedures</a>
        <a href="/careers/" class="btn btn-ghost">See open roles</a>
      </div>
    </div>
  </div>
</section>

<?php get_footer(); ?>
Written by

MukhtarAashury

← Back to blog Join the network