Skip to content

Instantly share code, notes, and snippets.

@nicooprat
Last active October 22, 2018 17:46
Show Gist options
  • Save nicooprat/9e435ed33d9fa5a7af1cf0febc583b97 to your computer and use it in GitHub Desktop.
Save nicooprat/9e435ed33d9fa5a7af1cf0febc583b97 to your computer and use it in GitHub Desktop.
Custom Gutenberg bloc with bare PHP
<?php
/*
Title: Témoignage
Description: test
Category: formatting
Icon: admin-comments
Keywords: testimonial quote
*/
?>
<blockquote data-<?php echo $block['id'] ?>>
<p><?php the_field('testimonial') ?></p>
<cite>
<img src="<?php echo get_field('picture')['url'] ?>" alt="<?php echo get_field('picture')['alt'] ?>" />
<span><?php the_field('author') ?></span>
</cite>
</blockquote>
<style type="text/css">
[data-<?php echo $block['id'] ?>] {
background: {{get_field('color')}};
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment