Created
February 6, 2023 16:44
-
-
Save bahiirwa/bb66e4e9358b1142497346939c2b4f58 to your computer and use it in GitHub Desktop.
Converting Classic Themes to Block Theme. How to use block templates parts
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 | |
/** | |
* Footer template. | |
* Add this to the HTML template in the parts directory in the theme. | |
*/ | |
if ( function_exists( 'block_template_part' ) ) { | |
block_template_part( 'footer-new-blocks' ); | |
} | |
/** | |
* Add theme support for block template parts. | |
* Add this to the functions.php in the theme. | |
*/ | |
function safaris_block_releated_theme_support() { | |
add_theme_support( 'block-template-parts' ); | |
} | |
add_action( 'after_setup_theme', 'safaris_block_releated_theme_support' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment