Created
November 29, 2018 13:08
-
-
Save NielsPilon/5075dc06bb15c730cb62316226506208 to your computer and use it in GitHub Desktop.
ACF Gutenberg block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Block Name: Testimonial | |
* | |
* Het template bestand wat we gebruiken voor ons Testimonial block | |
*/ | |
// afbeelding veld ophalen (array) | |
$avatar = get_field('afbeelding'); | |
// id attribuut aanmaken voor specifieke styling | |
$id = 'repeater-' . $block['id']; | |
// uitlijnings class aanmaken ("alignwide") vanuit de blok instellingen ("wide") | |
$align_class = $block['align'] ? 'align' . $block['align'] : ''; | |
?> | |
<blockquote id="<?php echo $id; ?>" class="testimonial <?php echo $align_class; ?>"> | |
<p><?php the_field('quote'); ?></p> | |
<cite> | |
<img src="<?php echo $avatar['url']; ?>" alt="<?php echo $avatar['alt']; ?>" /> | |
<span><?php the_field('naam'); ?></span> | |
</cite> | |
</blockquote> | |
<style type="text/css"> | |
#<?php echo $id; ?> { | |
background: <?php the_field('achtergrondkleur'); ?>; | |
color: <?php the_field('text_color'); ?>; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment