Last active
June 1, 2021 15:12
-
-
Save bradpotter/a236b6f93a7b5655956b872f7cee776f to your computer and use it in GitHub Desktop.
Place a reusable Gutenberg block via a Genesis hook. (Where 956 is the Post ID of your reusable block)
This file contains hidden or 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
add_action( 'genesis_before_footer', 'my_custom_query' ); | |
function my_custom_query() { | |
$post_id = 956; | |
$queried_post = get_post($post_id); | |
echo $queried_post->post_content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also worth mentioning that embeds won't work with this unless you also wrap in
This is what core does for widgets here:
https://github.com/WordPress/WordPress/blob/1314542c50e2ad2075b1304df20471febffb8fad/wp-includes/widgets/class-wp-widget-block.php#L75-L77