Templates and blocks

Hybrid classic and block templates

functions.php adds theme support for block-templates and block-template-parts. A post type with a block template in /templates (for example single-lh-portfolio.html) uses it; everything else keeps the classic PHP templates inherited from Baskerville or overridden here.

Shared markup functions

The header, footer and post furniture live in pluggable functions that both the classic templates and the block templates call, so there is one source and nothing to keep in sync by hand:

Dynamic blocks

Registered on init, each a thin wrapper that captures one of the functions above:

Block Bindings

includes/block-bindings.php registers two sources, each inactive unless its plugin is loaded:

A render_block filter removes any bound block with the class lh-hide-if-empty when its bound text resolves empty or its bound href/src is blank.

Skip links

The header markup outputs the theme’s own skip link to #site-content on every page. Core’s auto-injected block-template skip link is removed (its wp_enqueue_scripts hook is unhooked and the wp-block-template-skip-link handles are dequeued at priority 100) so block-template pages do not show two. Any future block template that does not use lh/legacy-header would need its own skip link.

WooCommerce

The theme declares WooCommerce support but ships no WooCommerce templates (they were removed in 0.2.2), so shop pages use WooCommerce’s own templates inside the theme’s header and footer.