wp_get_attachment_image_srcset( $logo, 'full' ) ),
array( 'sizes' => wp_get_attachment_image_sizes( $logo, 'full' ) ),
) );
}
/**
* Core header image
*/
public function header_image() {
$output = '
';
if ( ! botiga_get_display_conditions( 'header_image_display_conditions', false, '[{"type":"include","condition":"all","id":null}]' ) ) {
return;
}
echo wp_kses_post( $output );
}
/**
* Desktop header markup
*/
public function header_markup() {
$layout = get_theme_mod( 'header_layout_desktop', 'header_layout_1' );
call_user_func( array( $this, $layout ) ); ?>
'primary' ) ); ?>
';
}
?>
class="button header-item" href="">
';
echo wp_kses_post( $header_html_content );
echo '';
}
/**
* Shortcode
*/
public function shortcode() {
$header_shortcode_content = get_theme_mod( 'header_shortcode_content' );
if( ! $header_shortcode_content ) {
return '';
}
echo '';
}
/**
* Login/Register
*/
public function login_register() {
$endpoints = wc_get_account_menu_items();
$output = '';
if( ! class_exists( 'Woocommerce' ) ) {
return '';
}
if( is_user_logged_in() ) {
$show_welcome_message = get_theme_mod( 'login_register_show_welcome_message', 1 );
if( ! $show_welcome_message ) {
return;
}
$current_user = wp_get_current_user();
/* translators: 1: display name. */
$welcome_message_text = get_theme_mod( 'login_register_welcome_message_text', sprintf( esc_html__( 'Welcome %s', 'botiga' ), '{display_name}' ) );
$welcome_message_text = str_replace(
array( '{user_firstname}', '{user_lastname}', '{user_email}', '{user_login}', '{display_name}' ),
array( $current_user->user_firstname, $current_user->user_lastname, $current_user->user_email, $current_user->user_login, $current_user->display_name ),
$welcome_message_text
);
$output .= '' . esc_html( $welcome_message_text ) . '';
$output .= '';
} else {
$login_register_link_text = get_theme_mod( 'login_register_link_text', esc_html__( 'Login', 'botiga' ) );
$login_register_popup = Botiga_Modules::is_module_active( 'login-popup' );
$link_classes = array( 'botiga-login-register-link' );
if( $login_register_popup ) {
$link_classes[] = 'has-popup';
}
$output .= ''. esc_html( $login_register_link_text ) .'';
}
echo '';
}
/**
* Woocommerce icons
*/
public function woocommerce_icons() {
if ( !class_exists( 'WooCommerce' ) ) {
return;
}
echo botiga_woocommerce_header_cart(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Mobile Woocommerce icons
*/
public function mobile_woocommerce_icons() {
if ( !class_exists( 'WooCommerce' ) ) {
return;
}
get_template_part( 'template-parts/header-mobile/content-header-mobile', 'icons' );
}
/**
* Mobile Offcanvas Woocommerce icons
*/
public function mobile_offcanvas_woocommerce_icons() {
if ( !class_exists( 'WooCommerce' ) ) {
return;
}
get_template_part( 'template-parts/header-mobile/content-header-mobile-offcanvas', 'icons' );
}
/**
* Search icon
*/
public function search() {
?>
'primary' ) );
}
$icon = get_theme_mod( 'mobile_menu_icon', 'mobile-icon2' ); ?>
ID ) ? get_post_meta( $post->ID, '_botiga_disable_header_transparent', true ) : false;
if( $post_meta_disable ) {
return;
}
// Header Transparent Display Conditions
if ( ! botiga_get_display_conditions( 'header_transparent_display_on', false ) ) {
return;
}
if( $topbar_transparent ) {
add_action( 'botiga_header', array( $this, 'header_transparent_wrapper_open' ), -1 );
} else {
add_action( 'botiga_header', array( $this, 'header_transparent_wrapper_open' ), 9 );
}
if( $header_transparent ) {
add_action( 'botiga_header', array( $this, 'header_transparent_wrapper_close' ), 11 );
} else {
add_action( 'botiga_header', array( $this, 'header_transparent_wrapper_close' ), 6 );
}
add_filter( 'body_class', function( $classes ){
$classes[] = 'header-transparent';
return $classes;
} );
}
public function header_transparent_wrapper_open() {
echo '';
}
}
/**
* Initialize class
*/
Botiga_Header::get_instance();
endif;