Created
August 2, 2022 21:48
-
-
Save colorful-tones/4aa8fab606aa683c3d16ca814f8c75ae to your computer and use it in GitHub Desktop.
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
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header"} /--> | |
<!-- wp:group {"tagName":"main","className":"site-content","style":{"spacing":{"margin":{"top":"0"}}}} --> | |
<main class="wp-block-group site-content" style="margin-top:0"> | |
<!-- wp:pattern {"slug":"frost/page-home"} /--> | |
</main> | |
<!-- /wp:group --> | |
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer"} /--> |
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 | |
/** | |
* Title: Sample home page. | |
* Slug: frost/page-home | |
* Categories: frost-page | |
* Viewport Width: 1280 | |
*/ | |
$has_static_page = get_option( 'page_on_front' ); | |
?> | |
<?php if ( ! $has_static_page ) : ?> | |
<!-- wp:paragraph --> | |
<p><?php echo esc_html__( 'Front page', 'frost' ); ?></p> | |
<!-- /wp:paragraph --> | |
<?php else : ?> | |
<!-- wp:paragraph --> | |
<p><?php echo esc_html__( 'Other', 'frost' ); ?></p> | |
<!-- /wp:paragraph --> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These files would go in the corresponding directories:
patterns/page-home.php
- has a conditional check forget_option( 'page_on_front' );
which loads different content based on response.templates/front-page.html
- references and loads thepatterns/page-home.php
.