-
Notifications
You must be signed in to change notification settings - Fork 365
Quadrat: use php based header template #3654
Conversation
Quadrat: Override BCB's index.html template
quadrat/template-parts/header.php
Outdated
| <header id="masthead" class="site-header" role="banner"> | ||
| <div class="site-branding"> | ||
| <?php if ( has_custom_logo() ) : ?> | ||
| <div class="site-logo"><?php the_custom_logo(); ?></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could reduce this file to only use php for mostly just the navigation. We could replace some of the php using blocks like in this case we could simply do <?php echo do_blocks( '<!-- wp:site-logo {"align":"center","width":128} /-->' ); ?> I tested locally and that seemed to work fine and was editable via the customizer
* Quadrat: Add new heading sizes * Quadrat: Further work on Lists and Quotes * Quadrat: Remove whitespace * Quadrat: Add responsive Heading font-sizes
* Add the hosts block pattern. * Fix categories. * Update img refs. * Add alt text to media text pattern. * Revise block pattern names.
* override BCB's templates with php ones
|
Note: we prefer #3658 which depends on a Gutenberg change. |
quadrat/template-parts/header.php
Outdated
| 'theme_location' => 'primary', | ||
| 'menu_class' => 'menu-wrapper', | ||
| 'container_class' => 'primary-menu-container', | ||
| 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we have to use PHP to render this I think it would still be good to use add_theme_support( 'block-nav-menus' ); and render the menu like this. Those nav blocks are already styled in BCB settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, I will refactor this to use block-nav-menus.
0b57627 to
fd635dd
Compare
|
Closing! See #3714 |

This PR adds a header template that renders a classic menu. It's un-styled but I'm looking for input on the approach. I tried distilling it down to the minimum boilerplate required to support classic menus.
The PR also reorganizes the project a bit into
block-template-partsandtemplate-parts.I have a feeling this is going to be the ugliest part of the theme, so wanted to tackle it early.