You've already forked wp-bootstrap
v0.2.0 - Design Editor: templates, patterns, header/footer variations
Full Design Editor compatibility with custom block categories, page templates, header/footer variations, and navigation styles. Both FSE (admin) and Twig (frontend) sides kept in sync. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,11 +25,13 @@ class ContextBuilder
|
||||
public function build(): array
|
||||
{
|
||||
$context = [
|
||||
'site' => $this->getSiteData(),
|
||||
'menu' => $this->getMenuData('primary'),
|
||||
'footer_menu' => $this->getMenuData('footer'),
|
||||
'dark_mode' => true,
|
||||
'layout' => 'default',
|
||||
'site' => $this->getSiteData(),
|
||||
'menu' => $this->getMenuData('primary'),
|
||||
'footer_menu' => $this->getMenuData('footer'),
|
||||
'dark_mode' => true,
|
||||
'layout' => 'default',
|
||||
'header_variant' => $this->getHeaderVariant(),
|
||||
'footer_variant' => $this->getFooterVariant(),
|
||||
];
|
||||
|
||||
if (is_singular()) {
|
||||
@@ -448,6 +450,26 @@ class ContextBuilder
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the active header variant.
|
||||
*
|
||||
* @since 0.2.0
|
||||
*/
|
||||
private function getHeaderVariant(): string
|
||||
{
|
||||
return get_theme_mod('wp_bootstrap_header_variant', 'default');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the active footer variant.
|
||||
*
|
||||
* @since 0.2.0
|
||||
*/
|
||||
private function getFooterVariant(): string
|
||||
{
|
||||
return get_theme_mod('wp_bootstrap_footer_variant', 'default');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get terms list for a taxonomy.
|
||||
*/
|
||||
|
||||
@@ -82,7 +82,14 @@ class TemplateController
|
||||
}
|
||||
|
||||
if (is_page()) {
|
||||
return 'pages/page.html.twig';
|
||||
$slug = get_page_template_slug();
|
||||
return match ($slug) {
|
||||
'page-landing' => 'pages/landing.html.twig',
|
||||
'page-full-width' => 'pages/full-width.html.twig',
|
||||
'page-hero' => 'pages/hero.html.twig',
|
||||
'page-sidebar' => 'pages/page-sidebar.html.twig',
|
||||
default => 'pages/page.html.twig',
|
||||
};
|
||||
}
|
||||
|
||||
if (is_archive()) {
|
||||
|
||||
Reference in New Issue
Block a user