Update pledge page template to show elected candidates.
This commit is contained in:
@@ -97,6 +97,12 @@ $councilCount = count($councils);
|
||||
<?php
|
||||
$candidate = $chunk[$columnIdx];
|
||||
|
||||
if (isset($candidate['Elected']) && $candidate['Elected'] === 'y') {
|
||||
$candidate_elected = true;
|
||||
} else {
|
||||
$candidate_elected = false;
|
||||
}
|
||||
|
||||
if (isset($candidate['Picture']) && strlen($candidate['image_url'])) {
|
||||
$candidate_image['url'] = $candidate['image_url'];
|
||||
$candidate_image['id'] = $candidate['image_id'];
|
||||
@@ -107,7 +113,11 @@ $councilCount = count($councils);
|
||||
?>
|
||||
|
||||
<!-- wp:image {"id":<?php echo $candidate_image['id']; ?>,"width":"200px","height":"200px","scale":"cover","align":"center","style":{"color":{}},"className":"is-resized"} -->
|
||||
<figure class="wp-block-image aligncenter is-resized"><img src="<?php echo $candidate_image['url']; ?>" alt="" class="wp-image-<?php echo $candidate_image['id']; ?>" style="object-fit:cover;width:200px;height:200px"/></figure>
|
||||
<figure class="wp-block-image aligncenter is-resized <?php if ($candidate_elected) { echo "elected-candidate"; } ?>"><img src="<?php echo $candidate_image['url']; ?>" alt="" class="wp-image-<?php echo $candidate_image['id']; ?>" style="object-fit:cover;width:200px;height:200px;"/>
|
||||
<?php if ($candidate_elected): ?>
|
||||
<figcaption>ELECTED</figcaption>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<!-- /wp:image -->
|
||||
|
||||
<!-- wp:heading {"textAlign":"center","className":"wp-block-heading has-text-align-center has-medium-font-size","style":{"spacing":{"margin":{"top":"1rem","bottom":"0.5rem"}}}} -->
|
||||
|
||||
Reference in New Issue
Block a user