Skip to content

Commit

Permalink
Show company logo on People cards
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Abraham <[email protected]>
  • Loading branch information
cjyabraham committed Jun 13, 2024
1 parent 5cda3fe commit 7d1846e
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions web/wp-content/themes/cncf-twenty-two/components/people-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
$person_id = get_the_ID();
$person_slug = $post->post_name;
$company = get_post_meta( get_the_ID(), 'lf_person_company', true );
$company_logo_url = get_post_meta( get_the_ID(), 'lf_person_company_logo_url', true );
$company_landscape_url = get_post_meta( get_the_ID(), 'lf_person_company_landscape_url', true );
$pronouns = ucwords( get_post_meta( get_the_ID(), 'lf_person_pronouns', true ), $separators = " \t\r\n\f\v\\;/" );
$gb_role = get_post_meta( get_the_ID(), 'lf_person_gb_role', true );
$toc_role = get_post_meta( get_the_ID(), 'lf_person_toc_role', true );
Expand Down Expand Up @@ -102,10 +104,28 @@ class="js-modal button-reset modal-<?php echo esc_html( $person_slug ); ?>">
<?php
endif;

if ( $company ) :
?>
<h4 class="person__company"><?php echo esc_html( $company ); ?></h4>
<?php endif; ?>
if ( $company ) {
if ( $company_logo_url ) {
if ( $company_landscape_url ) {
?>
<a href="<?php echo esc_url( $company_landscape_url ); ?>">
<img class="person__company-logo" src="<?php echo esc_attr( $company_logo_url ); ?>"
alt="Logo of <?php echo esc_html( $company ); ?>">
</a>
<?php
} else {
?>
<img class="person__company-logo" src="<?php echo esc_attr( $company_logo_url ); ?>"
alt="Logo of <?php echo esc_html( $company ); ?>">
<?php
}
} else {
?>
<h4 class="person__company"><?php echo esc_html( $company ); ?></h4>
<?php
}
}
?>

<div class="person__social">
<?php
Expand Down

0 comments on commit 7d1846e

Please sign in to comment.