// register Widget Area
function register_logo_widget_area() {
register_sidebar(array(
'name' => 'Logo Widget Area',
'id' => 'logo_widget_area',
'description' => 'Widget Area im Logo Container',
'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">',
'after_widget' => '</section>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>',
));
}
add_action( 'widgets_init', 'register_logo_widget_area', 1001 );
// Insert widget area as sibling to anchor
function kriesi_logo_final_output($logo, $use_image, $headline_type, $sub, $alt, $link, $title) {
// Filter only for some page-ids - here only that one page
if (! is_page(array(54349))) {
return $logo;
}
$logo_tag = 'div';
if ( is_active_sidebar( 'logo_widget_area' ) ) {
ob_start();
dynamic_sidebar( 'logo_widget_area' );
$widget_content = ob_get_clean();
$logo = str_replace( '<' . $headline_type, '<' . $logo_tag, $logo);
$logo = str_replace('</' . $headline_type . '>', $widget_content . '</' . $logo_tag . '>', $logo);
} else {
$logo = str_replace( '<' . $headline_type, '<' . $logo_tag, $logo);
$logo = str_replace('</' . $headline_type . '>', '</' . $logo_tag . '>', $logo);
}
return $logo;
}
add_filter('avf_logo_final_output', 'kriesi_logo_final_output', 10, 7);css setting
#top .logo {
display: flex;
flex-flow: row nowrap;
justify-content: space-between; /* flex-start for widget-area next to logo */
align-content: center;
align-items: center;
gap: 20px;
width: 100% !important
}
#top .logo > a {
display: flex;
align-items: center;
flex-shrink: 1;
}
#top .logo .widget {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
align-self: center;
padding: 0 !important;
height: inherit;
line-height: initial;
}
#top .logo .widget:before,
#top .logo .widget:after {
display: none !important;
}
.html_header_top.html_bottom_nav_header #header_main_alternate .main_menu .menu-item-search-dropdown {
float: left;
}
.html_header_top.html_bottom_nav_header #header_main_alternate .main_menu {
width: auto;
left: 50%;
transform: translateX(-50%);
}
#top .logo .widget .widgettitle {
padding: 5px 0;
margin-bottom: 5px
}
@media only screen and (max-width: 989px) {
.responsive #top #wrap_all #header .container {
width: 95%;
max-width: 95%;
}
#top .logo .widget {
align-items: flex-start;
}
.responsive #top #header_main > .container .main_menu .av-main-nav > li > a {
line-height: 80px !important;
height: 80px !important;
}
}
@media only screen and (min-width: 768px ) and (max-width: 989px) {
#top .logo {
display: grid !important;
grid-template-columns: 1fr 1fr;
width: calc(100% - 80px) !important;
justify-content: flex-start;
}
}
@media only screen and (max-width: 767px) {
#top #header,
#top .header_bg {
height: 210px !important;
max-height: 210px !important;
}
.responsive #top #wrap_all #main {
padding-top: 210px !important;
border-bottom: 3px solid #000
}
#top .logo .widget {
align-items: center;
}
}