Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi
File: theme-header.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Template partial used to add content to the page in Theme Builder.
[2] Fix | Delete
* Duplicates partial content from header.php in order to maintain
[3] Fix | Delete
* backwards compatibility with child themes.
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
if ( et_builder_is_product_tour_enabled() || is_page_template( 'page-template-blank.php' ) ) {
[7] Fix | Delete
return;
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
$template_directory_uri = get_template_directory_uri();
[11] Fix | Delete
$et_secondary_nav_items = et_divi_get_top_nav_items();
[12] Fix | Delete
$et_phone_number = $et_secondary_nav_items->phone_number;
[13] Fix | Delete
$et_email = $et_secondary_nav_items->email;
[14] Fix | Delete
$et_contact_info_defined = $et_secondary_nav_items->contact_info_defined;
[15] Fix | Delete
$show_header_social_icons = $et_secondary_nav_items->show_header_social_icons;
[16] Fix | Delete
$et_secondary_nav = $et_secondary_nav_items->secondary_nav;
[17] Fix | Delete
$et_top_info_defined = $et_secondary_nav_items->top_info_defined;
[18] Fix | Delete
$et_slide_header = 'slide' === et_get_option( 'header_style', 'left' ) || 'fullscreen' === et_get_option( 'header_style', 'left' ) ? true : false;
[19] Fix | Delete
?>
[20] Fix | Delete
<?php if ( $et_top_info_defined && ! $et_slide_header || is_customize_preview() ) : ?>
[21] Fix | Delete
<?php ob_start(); ?>
[22] Fix | Delete
<div id="top-header"<?php echo $et_top_info_defined ? '' : 'style="display: none;"'; ?>>
[23] Fix | Delete
<div class="container clearfix">
[24] Fix | Delete
[25] Fix | Delete
<?php if ( $et_contact_info_defined ) : ?>
[26] Fix | Delete
[27] Fix | Delete
<div id="et-info">
[28] Fix | Delete
<?php if ( '' !== ( $et_phone_number = et_get_option( 'phone_number' ) ) ) : ?>
[29] Fix | Delete
<span id="et-info-phone"><?php echo et_core_esc_previously( et_sanitize_html_input_text( $et_phone_number ) ); ?></span>
[30] Fix | Delete
<?php endif; ?>
[31] Fix | Delete
[32] Fix | Delete
<?php if ( '' !== ( $et_email = et_get_option( 'header_email' ) ) ) : ?>
[33] Fix | Delete
<a href="<?php echo esc_attr( 'mailto:' . $et_email ); ?>"><span id="et-info-email"><?php echo esc_html( $et_email ); ?></span></a>
[34] Fix | Delete
<?php endif; ?>
[35] Fix | Delete
[36] Fix | Delete
<?php
[37] Fix | Delete
if ( true === $show_header_social_icons ) {
[38] Fix | Delete
get_template_part( 'includes/social_icons', 'header' );
[39] Fix | Delete
} ?>
[40] Fix | Delete
</div> <!-- #et-info -->
[41] Fix | Delete
[42] Fix | Delete
<?php endif; // true === $et_contact_info_defined ?>
[43] Fix | Delete
[44] Fix | Delete
<div id="et-secondary-menu">
[45] Fix | Delete
<?php
[46] Fix | Delete
if ( ! $et_contact_info_defined && true === $show_header_social_icons ) {
[47] Fix | Delete
get_template_part( 'includes/social_icons', 'header' );
[48] Fix | Delete
} else if ( $et_contact_info_defined && true === $show_header_social_icons ) {
[49] Fix | Delete
ob_start();
[50] Fix | Delete
[51] Fix | Delete
get_template_part( 'includes/social_icons', 'header' );
[52] Fix | Delete
[53] Fix | Delete
$duplicate_social_icons = ob_get_contents();
[54] Fix | Delete
[55] Fix | Delete
ob_end_clean();
[56] Fix | Delete
[57] Fix | Delete
printf(
[58] Fix | Delete
'<div class="et_duplicate_social_icons">
[59] Fix | Delete
%1$s
[60] Fix | Delete
</div>',
[61] Fix | Delete
et_core_esc_previously( $duplicate_social_icons )
[62] Fix | Delete
);
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
if ( '' !== $et_secondary_nav ) {
[66] Fix | Delete
echo et_core_esc_wp( $et_secondary_nav );
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
et_show_cart_total();
[70] Fix | Delete
?>
[71] Fix | Delete
</div> <!-- #et-secondary-menu -->
[72] Fix | Delete
[73] Fix | Delete
</div> <!-- .container -->
[74] Fix | Delete
</div> <!-- #top-header -->
[75] Fix | Delete
<?php
[76] Fix | Delete
$top_header = ob_get_clean();
[77] Fix | Delete
[78] Fix | Delete
/**
[79] Fix | Delete
* Filters the HTML output for the top header.
[80] Fix | Delete
*
[81] Fix | Delete
* @since 3.10
[82] Fix | Delete
*
[83] Fix | Delete
* @param string $top_header
[84] Fix | Delete
*/
[85] Fix | Delete
echo et_core_intentionally_unescaped( apply_filters( 'et_html_top_header', $top_header ), 'html' );
[86] Fix | Delete
?>
[87] Fix | Delete
<?php endif; // true ==== $et_top_info_defined ?>
[88] Fix | Delete
[89] Fix | Delete
<?php if ( $et_slide_header || is_customize_preview() ) : ?>
[90] Fix | Delete
<?php ob_start(); ?>
[91] Fix | Delete
<div class="et_slide_in_menu_container">
[92] Fix | Delete
<?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) || is_customize_preview() ) { ?>
[93] Fix | Delete
<span class="mobile_menu_bar et_toggle_fullscreen_menu"></span>
[94] Fix | Delete
<?php } ?>
[95] Fix | Delete
[96] Fix | Delete
<?php
[97] Fix | Delete
if ( $et_contact_info_defined || true === $show_header_social_icons || false !== et_get_option( 'show_search_icon', true ) || class_exists( 'woocommerce' ) || is_customize_preview() ) { ?>
[98] Fix | Delete
<div class="et_slide_menu_top">
[99] Fix | Delete
[100] Fix | Delete
<?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) ) { ?>
[101] Fix | Delete
<div class="et_pb_top_menu_inner">
[102] Fix | Delete
<?php } ?>
[103] Fix | Delete
<?php }
[104] Fix | Delete
[105] Fix | Delete
if ( true === $show_header_social_icons ) {
[106] Fix | Delete
get_template_part( 'includes/social_icons', 'header' );
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
et_show_cart_total();
[110] Fix | Delete
?>
[111] Fix | Delete
<?php if ( false !== et_get_option( 'show_search_icon', true ) || is_customize_preview() ) : ?>
[112] Fix | Delete
<?php if ( 'fullscreen' !== et_get_option( 'header_style', 'left' ) ) { ?>
[113] Fix | Delete
<div class="clear"></div>
[114] Fix | Delete
<?php } ?>
[115] Fix | Delete
<form role="search" method="get" class="et-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
[116] Fix | Delete
<?php
[117] Fix | Delete
printf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',
[118] Fix | Delete
esc_attr__( 'Search &hellip;', 'Divi' ),
[119] Fix | Delete
get_search_query(),
[120] Fix | Delete
esc_attr__( 'Search for:', 'Divi' )
[121] Fix | Delete
);
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* Fires inside the search form element, just before its closing tag.
[125] Fix | Delete
*
[126] Fix | Delete
* @since ??
[127] Fix | Delete
*/
[128] Fix | Delete
do_action( 'et_search_form_fields' );
[129] Fix | Delete
?>
[130] Fix | Delete
<button type="submit" id="searchsubmit_header"></button>
[131] Fix | Delete
</form>
[132] Fix | Delete
<?php endif; // true === et_get_option( 'show_search_icon', false ) ?>
[133] Fix | Delete
[134] Fix | Delete
<?php if ( $et_contact_info_defined ) : ?>
[135] Fix | Delete
[136] Fix | Delete
<div id="et-info">
[137] Fix | Delete
<?php if ( '' !== ( $et_phone_number = et_get_option( 'phone_number' ) ) ) : ?>
[138] Fix | Delete
<span id="et-info-phone"><?php echo et_core_esc_previously( et_sanitize_html_input_text( $et_phone_number ) ); ?></span>
[139] Fix | Delete
<?php endif; ?>
[140] Fix | Delete
[141] Fix | Delete
<?php if ( '' !== ( $et_email = et_get_option( 'header_email' ) ) ) : ?>
[142] Fix | Delete
<a href="<?php echo esc_attr( 'mailto:' . $et_email ); ?>"><span id="et-info-email"><?php echo esc_html( $et_email ); ?></span></a>
[143] Fix | Delete
<?php endif; ?>
[144] Fix | Delete
</div> <!-- #et-info -->
[145] Fix | Delete
[146] Fix | Delete
<?php endif; // true === $et_contact_info_defined ?>
[147] Fix | Delete
<?php if ( $et_contact_info_defined || true === $show_header_social_icons || false !== et_get_option( 'show_search_icon', true ) || class_exists( 'woocommerce' ) || is_customize_preview() ) { ?>
[148] Fix | Delete
<?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) ) { ?>
[149] Fix | Delete
</div> <!-- .et_pb_top_menu_inner -->
[150] Fix | Delete
<?php } ?>
[151] Fix | Delete
[152] Fix | Delete
</div> <!-- .et_slide_menu_top -->
[153] Fix | Delete
<?php } ?>
[154] Fix | Delete
[155] Fix | Delete
<div class="et_pb_fullscreen_nav_container">
[156] Fix | Delete
<?php
[157] Fix | Delete
$slide_nav = '';
[158] Fix | Delete
$slide_menu_class = 'et_mobile_menu';
[159] Fix | Delete
[160] Fix | Delete
$slide_nav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'echo' => false, 'items_wrap' => '%3$s' ) );
[161] Fix | Delete
$slide_nav .= wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'echo' => false, 'items_wrap' => '%3$s' ) );
[162] Fix | Delete
?>
[163] Fix | Delete
[164] Fix | Delete
<ul id="mobile_menu_slide" class="<?php echo esc_attr( $slide_menu_class ); ?>">
[165] Fix | Delete
[166] Fix | Delete
<?php
[167] Fix | Delete
if ( '' === $slide_nav ) :
[168] Fix | Delete
?>
[169] Fix | Delete
<?php if ( 'on' === et_get_option( 'divi_home_link' ) ) { ?>
[170] Fix | Delete
<li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?></a></li>
[171] Fix | Delete
<?php }; ?>
[172] Fix | Delete
[173] Fix | Delete
<?php show_page_menu( $slide_menu_class, false, false ); ?>
[174] Fix | Delete
<?php show_categories_menu( $slide_menu_class, false ); ?>
[175] Fix | Delete
<?php
[176] Fix | Delete
else :
[177] Fix | Delete
echo et_core_esc_wp( $slide_nav ) ;
[178] Fix | Delete
endif;
[179] Fix | Delete
?>
[180] Fix | Delete
[181] Fix | Delete
</ul>
[182] Fix | Delete
</div>
[183] Fix | Delete
</div>
[184] Fix | Delete
<?php
[185] Fix | Delete
$slide_header = ob_get_clean();
[186] Fix | Delete
[187] Fix | Delete
/**
[188] Fix | Delete
* Filters the HTML output for the slide header.
[189] Fix | Delete
*
[190] Fix | Delete
* @since 3.10
[191] Fix | Delete
*
[192] Fix | Delete
* @param string $top_header
[193] Fix | Delete
*/
[194] Fix | Delete
echo et_core_intentionally_unescaped( apply_filters( 'et_html_slide_header', $slide_header ), 'html' );
[195] Fix | Delete
?>
[196] Fix | Delete
<?php endif; // true ==== $et_slide_header ?>
[197] Fix | Delete
[198] Fix | Delete
<?php ob_start(); ?>
[199] Fix | Delete
<header id="main-header" data-height-onload="<?php echo esc_attr( et_get_option( 'menu_height', '66' ) ); ?>">
[200] Fix | Delete
<div class="container clearfix et_menu_container">
[201] Fix | Delete
<?php
[202] Fix | Delete
$logo = ( $user_logo = et_get_option( 'divi_logo' ) ) && ! empty( $user_logo )
[203] Fix | Delete
? $user_logo
[204] Fix | Delete
: $template_directory_uri . '/images/logo.png';
[205] Fix | Delete
[206] Fix | Delete
ob_start();
[207] Fix | Delete
?>
[208] Fix | Delete
<div class="logo_container">
[209] Fix | Delete
<span class="logo_helper"></span>
[210] Fix | Delete
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
[211] Fix | Delete
<img src="<?php echo esc_attr( $logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" id="logo" data-height-percentage="<?php echo esc_attr( et_get_option( 'logo_height', '54' ) ); ?>" />
[212] Fix | Delete
</a>
[213] Fix | Delete
</div>
[214] Fix | Delete
<?php
[215] Fix | Delete
$logo_container = ob_get_clean();
[216] Fix | Delete
[217] Fix | Delete
/**
[218] Fix | Delete
* Filters the HTML output for the logo container.
[219] Fix | Delete
*
[220] Fix | Delete
* @since 3.10
[221] Fix | Delete
*
[222] Fix | Delete
* @param string $logo_container
[223] Fix | Delete
*/
[224] Fix | Delete
echo et_core_intentionally_unescaped( apply_filters( 'et_html_logo_container', $logo_container ), 'html' );
[225] Fix | Delete
?>
[226] Fix | Delete
<div id="et-top-navigation" data-height="<?php echo esc_attr( et_get_option( 'menu_height', '66' ) ); ?>" data-fixed-height="<?php echo esc_attr( et_get_option( 'minimized_menu_height', '40' ) ); ?>">
[227] Fix | Delete
<?php if ( ! $et_slide_header || is_customize_preview() ) : ?>
[228] Fix | Delete
<nav id="top-menu-nav">
[229] Fix | Delete
<?php
[230] Fix | Delete
$menuClass = 'nav';
[231] Fix | Delete
if ( 'on' === et_get_option( 'divi_disable_toptier' ) ) $menuClass .= ' et_disable_top_tier';
[232] Fix | Delete
$primaryNav = '';
[233] Fix | Delete
[234] Fix | Delete
$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false ) );
[235] Fix | Delete
if ( empty( $primaryNav ) ) :
[236] Fix | Delete
?>
[237] Fix | Delete
<ul id="top-menu" class="<?php echo esc_attr( $menuClass ); ?>">
[238] Fix | Delete
<?php if ( 'on' === et_get_option( 'divi_home_link' ) ) { ?>
[239] Fix | Delete
<li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?></a></li>
[240] Fix | Delete
<?php }; ?>
[241] Fix | Delete
[242] Fix | Delete
<?php show_page_menu( $menuClass, false, false ); ?>
[243] Fix | Delete
<?php show_categories_menu( $menuClass, false ); ?>
[244] Fix | Delete
</ul>
[245] Fix | Delete
<?php
[246] Fix | Delete
else :
[247] Fix | Delete
echo et_core_esc_wp( $primaryNav );
[248] Fix | Delete
endif;
[249] Fix | Delete
?>
[250] Fix | Delete
</nav>
[251] Fix | Delete
<?php endif; ?>
[252] Fix | Delete
[253] Fix | Delete
<?php
[254] Fix | Delete
if ( ! $et_top_info_defined && ( ! $et_slide_header || is_customize_preview() ) ) {
[255] Fix | Delete
et_show_cart_total( array(
[256] Fix | Delete
'no_text' => true,
[257] Fix | Delete
) );
[258] Fix | Delete
}
[259] Fix | Delete
?>
[260] Fix | Delete
[261] Fix | Delete
<?php if ( $et_slide_header || is_customize_preview() ) : ?>
[262] Fix | Delete
<span class="mobile_menu_bar et_pb_header_toggle et_toggle_<?php echo esc_attr( et_get_option( 'header_style', 'left' ) ); ?>_menu"></span>
[263] Fix | Delete
<?php endif; ?>
[264] Fix | Delete
[265] Fix | Delete
<?php if ( ( false !== et_get_option( 'show_search_icon', true ) && ! $et_slide_header ) || is_customize_preview() ) : ?>
[266] Fix | Delete
<div id="et_top_search">
[267] Fix | Delete
<span id="et_search_icon"></span>
[268] Fix | Delete
</div>
[269] Fix | Delete
<?php endif; // true === et_get_option( 'show_search_icon', false ) ?>
[270] Fix | Delete
[271] Fix | Delete
<?php
[272] Fix | Delete
[273] Fix | Delete
/**
[274] Fix | Delete
* Fires at the end of the 'et-top-navigation' element, just before its closing tag.
[275] Fix | Delete
*
[276] Fix | Delete
* @since 1.0
[277] Fix | Delete
*/
[278] Fix | Delete
do_action( 'et_header_top' );
[279] Fix | Delete
[280] Fix | Delete
?>
[281] Fix | Delete
</div> <!-- #et-top-navigation -->
[282] Fix | Delete
</div> <!-- .container -->
[283] Fix | Delete
<div class="et_search_outer">
[284] Fix | Delete
<div class="container et_search_form_container">
[285] Fix | Delete
<form role="search" method="get" class="et-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
[286] Fix | Delete
<?php
[287] Fix | Delete
printf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',
[288] Fix | Delete
esc_attr__( 'Search &hellip;', 'Divi' ),
[289] Fix | Delete
get_search_query(),
[290] Fix | Delete
esc_attr__( 'Search for:', 'Divi' )
[291] Fix | Delete
);
[292] Fix | Delete
[293] Fix | Delete
/**
[294] Fix | Delete
* Fires inside the search form element, just before its closing tag.
[295] Fix | Delete
*
[296] Fix | Delete
* @since ??
[297] Fix | Delete
*/
[298] Fix | Delete
do_action( 'et_search_form_fields' );
[299] Fix | Delete
?>
[300] Fix | Delete
</form>
[301] Fix | Delete
<span class="et_close_search_field"></span>
[302] Fix | Delete
</div>
[303] Fix | Delete
</div>
[304] Fix | Delete
</header> <!-- #main-header -->
[305] Fix | Delete
<?php
[306] Fix | Delete
$main_header = ob_get_clean();
[307] Fix | Delete
[308] Fix | Delete
/**
[309] Fix | Delete
* Filters the HTML output for the main header.
[310] Fix | Delete
*
[311] Fix | Delete
* @since 3.10
[312] Fix | Delete
*
[313] Fix | Delete
* @param string $main_header
[314] Fix | Delete
*/
[315] Fix | Delete
echo et_core_intentionally_unescaped( apply_filters( 'et_html_main_header', $main_header ), 'html' );
[316] Fix | Delete
?>
[317] Fix | Delete
[318] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function