', esc_attr( $classes ) );
call_user_func( 'blogsy_top_bar_widget_' . $widget['type'], $widget['values'] );
printf( '' );
}
}
}
do_action( 'blogsy_top_bar_widgets_after_' . $location );
}
add_action( 'blogsy_topbar_widgets', 'blogsy_topbar_widgets_output' );
/**
* Outputs the theme header area.
*
* @since 1.0.0
*/
function blogsy_header_output(): void {
if ( ! blogsy_is_header_displayed() ) {
return;
}
get_template_part( 'template-parts/header/base' );
}
add_action( 'blogsy_header', 'blogsy_header_output', 20 );
/**
* Outputs the header widgets in Header Widget Locations.
*
* @since 1.0.0
* @param array $locations Widget locations.
*/
function blogsy_header_widgets( array $locations ): void {
$all_widgets = (array) apply_filters( 'blogsy_main_header_selected_widgets', Helper::get_option( 'header_widgets' ) );
blogsy_header_widget_output( $locations, $all_widgets );
}
add_action( 'blogsy_header_widget_location', 'blogsy_header_widgets', 1 );
/**
* Outputs the content of theme header.
*
* @since 1.0.0
*/
function blogsy_header_content_output(): void {
// Get the selected header layout from Customizer.
$header_layout = Helper::get_option( 'header_layout' );
?>
isset( $widget['type'] ) && 'search' === $widget['type'] && 3 === (int) $widget['values']['style']
);
$search_widget = reset( $search_widget );
get_template_part( 'template-parts/header/navigation', '', $search_widget ? $search_widget['values'] : [] );
}
/**
* Output the Header logo template.
*
* @since 1.0.0
*/
function blogsy_header_logo_template(): void {
get_template_part( 'template-parts/header/logo' );
}
/**
* Outputs the theme Ticker News content.
*
* @since 1.0.0
*/
function blogsy_blog_ticker(): void {
if ( ! blogsy_is_ticker_displayed() ) {
return;
}
do_action( 'blogsy_before_ticker' );
?>
>
>
$hero_data['page_id'] ] );
} else {
$hero_type = is_array( $hero_data ) && ! empty( $hero_data['type'] ) ? $hero_data['type'] : Helper::get_option( 'hero_type' );
get_template_part( 'template-parts/hero/hero', $hero_type, is_array( $hero_data ) ? $hero_data : [] );
}
?>
>
>
>
>
isset( $widget['values']['display_area'] ) && in_array( $arg, $widget['values']['display_area'] )
);
foreach ( $arr_widgets as $widget ) {
if ( function_exists( 'blogsy_ad_widget_' . $widget['type'] ) ) {
$classes = [];
$classes[] = 'blogsy-banner-widget__' . esc_attr( $widget['type'] );
$classes[] = 'blogsy-banner-widget';
if ( isset( $widget['values']['visibility'] ) && $widget['values']['visibility'] ) {
$classes[] = 'blogsy-' . esc_attr( $widget['values']['visibility'] );
}
$classes = apply_filters( 'blogsy_ad_widget_classes', $classes, $widget );
$classes = trim( implode( ' ', $classes ) );
printf( '', esc_attr( $classes ) );
call_user_func( 'blogsy_ad_widget_' . $widget['type'], $widget['values'] );
printf( '
' );
}
}
}
add_action( 'blogsy_before_single_content', 'blogsy_advertisement_part', 10, 1 );
add_action( 'blogsy_after_single_content', 'blogsy_advertisement_part', 10, 1 );
add_action( 'blogsy_before_masthead', 'blogsy_advertisement_part', 10, 1 );
add_action( 'blogsy_after_masthead', 'blogsy_advertisement_part', 10, 1 );
add_action( 'blogsy_before_footer', 'blogsy_advertisement_part', 10, 1 );
add_action( 'blogsy_after_footer', 'blogsy_advertisement_part', 10, 1 );
add_action( 'blogsy_header_4_ad', 'blogsy_advertisement_part', 10, 1 );
add_action( 'blogsy_before_content_area', 'blogsy_advertisement_part', 10, 1 );