芝麻web文件管理V1.00
编辑当前文件:/home/mybf1/www/rambut.bf1.my/wp-content/themes/izo/inc/class_izo_header.php
ID, '_izo_hide_header', true ); if ( $disable_header ) { return; } } ?>
get_component( 'left' ); ?>
get_component( 'right' ); ?>
site_branding(); ?>
main_navigation(); ?>
site_logo(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( is_front_page() && is_home() ) : ?>
'primary-menu') ); ?>
>
> 'primary-menu', 'menu_id' => 'primary-menu', 'fallback_cb' => 'izo_main_nav_fallback', ) ); ?>
'; $phone = get_theme_mod( 'header_phone', '+99.11.33.22' ); $mail = get_theme_mod( 'header_mail', 'office@example.org' ); $data .= '
' . izo_get_svg_icon( 'icon-phone', false ) . esc_html( $phone ) . '
'; $data .= '
' . izo_get_svg_icon( 'icon-mail', false ) . esc_html( antispambot( $mail ) ) . '
'; $data .= '
'; echo $data; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Header text */ function header_component_text() { $text = get_theme_mod( 'header_custom_text', 'Lorem ipsum dolor sit amet' ); $data = '
'; $data .= wp_kses_post( $text ); $data .= '
'; echo $data; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Top navigation */ function header_component_top_nav() { ?> 'top-menu') ); ?>
'top-menu', 'menu_id' => 'top-menu', 'fallback_cb' => false, 'depth' => 1 ) ); ?>
'; foreach ( $socials as $social ) { $network = izo_get_social_network( $social ); if ( $network ) { echo '
' . izo_get_svg_icon( 'icon-' . esc_html( $network ), false ) . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } echo ''; } /** * Header search form */ function header_search_form() { get_search_form(); } /** * Get the component for a specific top header area */ public function get_component( $location ) { switch ( $location ) { case 'left': $default = 'header_component_contact'; break; case 'right': $default = 'header_component_text'; break; } $component = get_theme_mod( $location . '_top_bar_component' , $default ); if ( 'nothing' === $component ) { return; } $this->$component(); } /** * Handles header bars merging */ public function merge_menu_bar() { global $post; if ( !isset( $post ) ) { return; } $merge_bottom_bar = get_post_meta( $post->ID, '_izo_merge_bottom_bar', true ); if ( $merge_bottom_bar ) { echo 'is-merged'; } } /** * Site logo */ public function site_logo() { global $post; if ( !isset( $post ) ) { return get_custom_logo(); } $merge_bottom_bar = get_post_meta( $post->ID, '_izo_merge_bottom_bar', true ); $logo_transparent = get_theme_mod( 'logo_transparent' ); if ( $merge_bottom_bar && $logo_transparent ) { //logo for pages that have the transparent mode active $aria_current = is_front_page() && ! is_paged() ? ' aria-current="page"' : ''; $logo = sprintf( '
%3$s
', esc_url( home_url( '/' ) ), $aria_current, '
' ); } else { //core logo $logo = get_custom_logo(); } return $logo; } /** * Last menu item */ public function last_menu_item( $items, $args ) { $lastitem = get_theme_mod( 'main_header_last_item', 'main_header_component_nothing' ); if ( 'main_header_component_nothing' == $lastitem ) { return $items; //return if we don't have to show anything here } if ( 'primary-menu' != $args -> theme_location ) { return $items; //return if this is not the main menu } switch( $lastitem ) { //Button case 'main_header_component_button': $url = get_theme_mod( 'main_header_button_url', '#' ); $text = get_theme_mod( 'main_header_button_text', esc_attr__( 'Click me', 'izo' ) ); $newtab = get_theme_mod( 'main_header_button_newtab', 0 ); $target = ''; if ( $newtab ) { $target = 'target="_blank"'; } $items .= '
' . esc_html( $text ) . '
'; break; //Text case 'main_header_component_text': $text = get_theme_mod( 'main_header_custom_text', 'Lorem ipsum dolor sit amet' ); $items .= '
' . wp_kses_post( $text ) . '
'; break; //Search case 'main_header_component_search': $style = get_theme_mod( 'header_search_style', 'default' ); $items .= '
'; $items .= '
' . get_search_form( false ) . '
'; break; //Search case 'main_header_woocommerce': if ( class_exists( 'WooCommerce' ) ) { $items .= '
' . izo_woocommerce_header_cart() . '
'; } else { $items .= ''; } break; } return $items; } /** * Header image */ public function header_image() { if ( !get_header_image() ) { return; } $show_on_front = get_theme_mod( 'header_image_front_page', 0 ); if ( is_home() || is_front_page() && $show_on_front ) { echo '
'; the_header_image_tag(); echo '
'; } } /** * Handle site title and description display when logo is active */ public function display_site_title( $css ) { $display_site_title = get_theme_mod( 'display_site_title', 0 ); $has_logo = has_custom_logo(); if ( $has_logo && !$display_site_title ) { $css .= '.site-title,.site-description {position: absolute;clip: rect(1px, 1px, 1px, 1px);}'; } return $css; } } /** * Initialize class */ Izo_Header::get_instance(); endif;