Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add top-bar widget position #705

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@

<div id="page" class="site">

<!-- Top Bar Widget -->
<?php if (is_active_sidebar('top-bar')) : ?>
<?php dynamic_sidebar('top-bar'); ?>
<?php endif; ?>

<header id="masthead" class="site-header sticky-top bg-body-tertiary">

<nav id="nav-main" class="navbar navbar-expand-lg">
Expand Down
11 changes: 11 additions & 0 deletions inc/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
if (!function_exists('bootscore_widgets_init')) :

function bootscore_widgets_init() {

// Top Bar
register_sidebar(array(
'name' => esc_html__('Top Bar', 'bootscore'),
'id' => 'top-bar',
'description' => esc_html__('Add widgets here.', 'bootscore'),
'before_widget' => '<div class="top-bar-widget">',
'after_widget' => '</div>',
'before_title' => '<div class="widget-title d-none">',
'after_title' => '</div>'
));

// Top Nav
register_sidebar(array(
Expand Down