Skip to content

Instantly share code, notes, and snippets.

@royboy789

royboy789/single.php

Created Apr 24, 2018
Embed
What would you like to do?
Using Gutenberg Block Data
<?php
get_header();
the_post();
$blocks = get_editor_blocks( $post->ID );
if ( empty( $blocks ) ) {
echo '<p>No Blocks Found</p>';
} else {
foreach( $blocks as $block ) {
$data = $block->data;
get_template_part( 'blocks/' . $block->name );
}
}
get_footer();
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.