Digital Sovereignty for everyone

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:

  • lh_baskerville_header_markup() and lh_baskerville_footer_markup() in includes/template-parts.php: the header image, logo or site title, primary and mobile menus, search toggle, footer widget areas (with fallbacks) and credits.
  • lh_baskerville_post_meta_markup(), lh_baskerville_sidebar_markup() and lh_baskerville_comments_markup() in includes/legacy-post-content.php: the author box, date, categories and tags, previous/next links, sidebar and comments.
  • lh_baskerville_breadcrumbs_markup() in includes/legacy-breadcrumbs.php: renders core’s core/breadcrumbs block with a manually built postId/postType context on singular pages. Called once, at the end of the header markup.

Dynamic blocks

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

  • lh/legacy-header, lh/legacy-footer, lh/legacy-post-meta, lh/legacy-sidebar, lh/legacy-comments (includes/legacy-chrome-blocks.php)
  • lh/portfolio-toc (includes/portfolio-toc-block.php): lists an LH Portfolio root’s child entries by menu_order then title. Visitors see published children only; users who can edit_posts also see draft and private ones, marked with their status.

Block Bindings

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

  • lh/kb-entry (LH Knowledge Base): fields entry_type, last_updated, md_url.
  • lh/portfolio (LH Portfolio): fields type, lifecycle_stage, parent_title, parent_url.

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.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.