/** * Retrieve the markup for a custom header. * * The container div will always be returned in the Customizer preview. * * @since 4.7.0 * * @return string The markup for a custom header on success. */ function get_custom_header_markup() { if (!has_custom_header() && !is_customize_preview()) { return ''; } return sprintf('<div id="wp-custom-header" class="wp-custom-header">%s</div>', get_header_image_tag()); }
<?php /** * Displays header image * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ ?> <div class="custom-header"> <?php if (has_custom_header()) { ?> <div class="custom-header-image"> <?php the_custom_header_markup(); ?> </div> <?php } ?> <?php get_template_part('template-parts/header/site', 'branding'); ?> </div><!-- .custom-header -->
/** * Retrieve the markup for a custom header. * * @since 4.7.0 * * @return string|false The markup for a custom header on success. False if not. */ function get_custom_header_markup() { if (!has_custom_header()) { return false; } return sprintf('<div id="wp-custom-header" class="wp-custom-header">%s</div>', get_header_image_tag()); }
*/ ?> <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php _e('Top Menu', 'twentyseventeen'); ?> "> <button class="menu-toggle" aria-controls="top-menu" aria-expanded="false"><?php echo twentyseventeen_get_svg(array('icon' => 'bars')); echo twentyseventeen_get_svg(array('icon' => 'close')); _e('Menu', 'twentyseventeen'); ?> </button> <?php wp_nav_menu(array('theme_location' => 'top', 'menu_id' => 'top-menu')); ?> <?php if ((twentyseventeen_is_frontpage() || is_home() && is_front_page()) && has_custom_header()) { ?> <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg(array('icon' => 'arrow-right')); ?> <span class="screen-reader-text"><?php _e('Scroll down to content', 'twentyseventeen'); ?> </span></a> <?php } ?> </nav><!-- #site-navigation -->