// see: https://basis.webers-testseite.de/
// 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' => '<span class="seperator extralight-border"></span></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) {
// Optional: replace headline_type with div
$logo_tag = 'div';
if ( is_active_sidebar( 'logo_widget_area' ) ) {
ob_start();
dynamic_sidebar( 'logo_widget_area' );
$widget_content = ob_get_clean();
// Replace headline_type with your own tag and insert widget
$logo = str_replace('<' . $headline_type, '<' . $logo_tag, $logo);
$logo = str_replace('</' . $headline_type . '>', $widget_content . '</' . $logo_tag . '>', $logo);
} else {
// Replace the tag even without a widget
$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);