You've already forked wp-bootstrap
feat: Bootstrap 5 block renderer, widget cards, and sidebar post layout (v1.1.0)
Add BlockRenderer class injecting Bootstrap classes into 8 core block types (table, button, buttons, image, search, quote, pullquote, list) via per-block render_block filters using WP_HTML_Tag_Processor. Add WidgetRenderer class wrapping sidebar widgets in Bootstrap card components with h4 heading hierarchy via dynamic_sidebar_params and widget_block_content filters. Add widget SCSS stylesheet for list styling, search input-group, tag cloud pills, and card-flush list positioning. Add single-sidebar.html.twig as the default post template with two-column Bootstrap layout (col-lg-8 content, col-lg-4 sidebar). Full-width available via template selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -70,14 +70,19 @@ class ContextBuilder
|
||||
$context['sidebar'] = $this->getSidebarData();
|
||||
}
|
||||
|
||||
// Sidebar data for pages/posts using the "Page with Sidebar" template.
|
||||
if (is_page() || is_singular('post')) {
|
||||
// Sidebar data for pages using the "Page with Sidebar" template.
|
||||
if (is_page()) {
|
||||
$slug = get_page_template_slug();
|
||||
if ($slug === 'page-sidebar') {
|
||||
$context['sidebar'] = $this->getSidebarData();
|
||||
}
|
||||
}
|
||||
|
||||
// Posts always get sidebar data (sidebar is the default layout).
|
||||
if (is_singular('post')) {
|
||||
$context['sidebar'] = $this->getSidebarData();
|
||||
}
|
||||
|
||||
return $context;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,11 @@ class TemplateController
|
||||
}
|
||||
|
||||
if (is_singular('post')) {
|
||||
return 'pages/single.html.twig';
|
||||
$slug = get_page_template_slug();
|
||||
return match ($slug) {
|
||||
'page-full-width' => 'pages/single.html.twig',
|
||||
default => 'pages/single-sidebar.html.twig',
|
||||
};
|
||||
}
|
||||
|
||||
if (is_page()) {
|
||||
|
||||
Reference in New Issue
Block a user