'custom-logo',
'itemprop' => 'logo',
);
/*
* If the logo alt attribute is empty, get the site title and explicitly
* pass it to the attributes used by wp_get_attachment_image().
*/
$image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true );
if ( empty( $image_alt ) ) {
$custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' );
}
/*
* If the alt attribute is not empty, there's no need to explicitly pass
* it because wp_get_attachment_image() already adds the alt attribute.
*/
$html = sprintf( '%2$s',
esc_url( home_url( '/' ) ),
wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr )
);
}
return $html;
}
function ct_output_header_top_bar() {
$columns_output = '';
$header_section_1 = get_theme_mod(
'header_top_bar_section_1',
'header_menu'
);
$header_section_2 = get_theme_mod(
'header_top_bar_section_2',
'social_icons'
);
if ( $header_section_1 !== 'disabled' && $header_section_2 !== 'disabled' ) {
$columns_output = 'data-columns="2"';
} else {
if ( $header_section_1 !== 'disabled' || $header_section_2 !== 'disabled' ) {
$columns_output = 'data-columns="1"';
}
}
$container_class = (
get_theme_mod( 'top_bar_container', 'fixed' ) === 'fixed'
) ? 'ct-container' : 'ct-container-fluid';
$main_class = 'header-top-bar';
$main_class .= ' ' . ct_visibility_classes(
get_theme_mod('top_bar_visibility', [
'desktop' => true,
'tablet' => true,
'mobile' => false,
])
);
$stacking_output = ct_stacking(
get_theme_mod('top_bar_stacking', [
'tablet' => true,
'mobile' => true,
])
);
ob_start();
?>
'header_top_bar',
'depth' => 1,
'container' => false,
'menu_id' => 'header-top-bar-menu',
'menu_class' => 'header-top-bar-menu menu',
'fallback_cb' => 'ct_link_to_menu_editor',
]
);
$output = ob_get_clean();
}
if ( $kind === 'custom_text' ) {
$output = '' . get_theme_mod( 'header_top_bar_section_' . $number . '_text', 'Sample text' ) . '
';
}
if ( $kind === 'social_icons' ) {
$output = ct_social_icons(
get_theme_mod('header_top_bar_socials_' . $number, [
[
'id' => 'facebook',
'enabled' => true,
],
[
'id' => 'twitter',
'enabled' => true,
],
[
'id' => 'gplus',
'enabled' => true,
],
]),
'simple'
);
}
return '';
}
function ct_header_main_menu() {
?>
'header_top_bar',
'depth' => 1,
'container' => false,
'menu_id' => 'header-top-bar-menu',
'menu_class' => 'header-top-bar-menu menu',
'fallback_cb' => 'ct_link_to_menu_editor',
]
);
$output = '';
ct_add_customizer_preview_cache(
ct_html_tag(
'div',
[ 'data-id' => 'header-top-bar-menu' ],
$output
)
);
$output = '';
$output .= '' . get_theme_mod( 'header_top_bar_section_1_text', 'Sample text' ) . '';
$output .= '';
ct_add_customizer_preview_cache(
ct_html_tag(
'div',
[ 'data-id' => 'header-top-bar-text' ],
$output
)
);
ct_add_customizer_preview_cache(
ct_html_tag(
'div',
[ 'data-id' => 'header-top-bar-socials' ],
'' . ct_social_icons( null, 'simple' ) . ''
)
);
}