Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ACF Gutenberg block
* 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>
<img src="<?php echo $avatar['url']; ?>" alt="<?php echo $avatar['alt']; ?>" />
<span><?php the_field('naam'); ?></span>
<style type="text/css">
#<?php echo $id; ?> {
background: <?php the_field('achtergrondkleur'); ?>;
color: <?php the_field('text_color'); ?>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.