'', 'default-text-color' => 'ffffff', 'width' => 1920, 'height' => 1080, 'flex-height' => true, 'flex-width' => true, 'wp-head-callback' => 'businessexpo_header_style', ) ) ); } add_action( 'after_setup_theme', 'businessexpo_custom_header_setup' ); function businessexpo_header_style() { $header_text_color = get_header_textcolor(); /* * If no custom options for text are set, let's bail. * get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: HEADER_TEXTCOLOR. */ if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { return; } // If we get this far, we have custom styles. Let's do this. if ( ! display_header_text() ) : $custom_css = ".site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); }"; // If the user has set a custom color for the text use that. else : $custom_css = ".site-title, .site-description { color: #" . esc_attr( $header_text_color ) . "}"; endif; wp_add_inline_style( 'businessexpo-style', $custom_css ); } add_action( 'wp_enqueue_scripts', 'businessexpo_header_style' ); /** * Theme Page Header Title */ function businessexpo_theme_page_header_title(){ if( is_archive() ) { echo '

'; if ( is_day() ) : /* translators: %1$s %2$s: date */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('Archives','businessexpo'), get_the_date() ); elseif ( is_month() ) : /* translators: %1$s %2$s: month */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('Archives','businessexpo'), get_the_date( 'F Y' ) ); elseif ( is_year() ) : /* translators: %1$s %2$s: year */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('Archives','businessexpo'), get_the_date( 'Y' ) ); elseif( is_author() ): /* translators: %1$s %2$s: author */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('All posts by','businessexpo'), get_the_author() ); elseif( is_category() ): /* translators: %1$s %2$s: category */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('Category','businessexpo'), single_cat_title( '', false ) ); elseif( is_tag() ): /* translators: %1$s %2$s: tag */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('Tag','businessexpo'), single_tag_title( '', false ) ); elseif( class_exists( 'WooCommerce' ) && is_shop() ): /* translators: %1$s %2$s: WooCommerce */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('Shop','businessexpo'), single_tag_title( '', false )); elseif( is_archive() ): the_archive_title( '

', '

' ); endif; echo '
'; } elseif( is_404() ) { echo '

'; /* translators: %1$s: 404 */ printf( esc_html__( '%1$s', 'businessexpo' ) , esc_html__('Error 404','businessexpo') ); echo '

'; } elseif( is_search() ) { echo '

'; /* translators: %1$s %2$s: search */ printf( esc_html__( '%1$s %2$s', 'businessexpo' ), esc_html__('Search results for','businessexpo'), get_search_query() ); echo '

'; } else { echo '

'.esc_html( get_the_title() ).'

'; } } /** * Theme Breadcrumbs Url */ function businessexpo_page_url() { $page_url = 'http'; if ( key_exists("HTTPS", $_SERVER) && ( $_SERVER["HTTPS"] == "on" ) ){ $page_url .= "s"; } $page_url .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $page_url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $page_url .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $page_url; } /** * Theme Breadcrumbs */ if( !function_exists('businessexpo_page_header_breadcrumbs') ): function businessexpo_page_header_breadcrumbs() { global $post; $homeLink = home_url(); $businessexpo_page_header_layout = get_theme_mod('businessexpo_page_header_layout', 'businessexpo_page_header_layout1'); if($businessexpo_page_header_layout == 'businessexpo_page_header_layout1'): $breadcrumb_class = 'text-center'; else: $breadcrumb_class = 'text-right'; endif; echo ''; } endif; /** * Get sticky main menu class name **/ function businessexpo_sticky_main_menu_class() { $sticky_main_menu = get_theme_mod( 'businessexpo_menu_style', 'sticky' ); if ( $sticky_main_menu == 'sticky' ) { return 'site-menu-content--sticky'; } return ''; } /** * Check if admin bar is enabled **/ function businessexpo_is_admin_bar_enabled() { if ( is_admin_bar_showing() ) { return 'admin-bar-enabled'; } return ''; } /** * Select sanitization callback * */ function businessexpo_sanitize_select( $value ){ if ( is_array( $value ) ) { foreach ( $value as $key => $subvalue ) { $value[ $key ] = sanitize_text_field( $subvalue ); } return $value; } return sanitize_text_field( $value ); } ?>