-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try/header template part wrapped (#3714)
* Modified site-title styles to match comps * Added a navigation rendering function to render the navigation block based on a classic data source, wrap the output in an HTML block to be inserted anywhere blocks are do_block()'ed * Added a header template part that leverages the rendered navigation block markup * Replaced usage of navigation block template with new template-part * Added styles for header for proper layout unachievable with blocks.
- Loading branch information
Showing
13 changed files
with
81 additions
and
37 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
if ( ! function_exists( 'render_navigation_block' ) ) : | ||
|
||
function render_navigation_block( $menu_location ) { | ||
if ( ! has_nav_menu( $menu_location ) ) { | ||
return; | ||
} | ||
|
||
$nav_items = wp_nav_menu( | ||
array( | ||
'echo' => false, | ||
'theme_location' => $menu_location, | ||
'container' => '', | ||
'items_wrap' => '%3$s', | ||
'fallback_cb' => false, | ||
) | ||
); | ||
|
||
if ( ! $nav_items ) { | ||
return; | ||
} | ||
|
||
return '<!-- wp:html -->' . $nav_items . '<!-- /wp:html -->'; | ||
} | ||
endif; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.site-header { | ||
.wp-block-group { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@import "../../blank-canvas-blocks/sass/base/breakpoints"; // Get the mobile-only media query and make it available to this theme's styles | ||
@import "blocks/media-text"; | ||
@import "blocks/list"; | ||
@import "header"; | ||
@import "utility"; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Displays the header. | ||
* Needed until we have a consistent mechanism to render a navigation between FSE and classic menus. | ||
* | ||
* @package Quadrat | ||
* @since 1.0.0 | ||
* | ||
*/ | ||
|
||
require get_stylesheet_directory() . '/inc/render-navigation-block.php'; | ||
?> | ||
|
||
<header class="site-header" role="banner"> | ||
<?php | ||
echo do_blocks( | ||
'<!-- wp:group {"style":{"spacing":{"padding":{"right":"35px","left":"35px"}}}} --><div class="wp-block-group" style="padding-right:35px;padding-left:35px"> | ||
<!-- wp:site-title /-->' . | ||
render_navigation_block( 'primary' ) . | ||
'</div><!-- /wp:group -->' | ||
); | ||
?> | ||
</header> |
This file was deleted.
Oops, something went wrong.
Empty file.