function mh_newsdesk_lite_logo() { $header_img = get_header_image(); $header_title = get_bloginfo('name'); $header_desc = get_bloginfo('description'); echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr($header_title) . '" rel="home">' . "\n"; echo '<div class="logo-wrap" role="banner">' . "\n"; if ($header_img) { echo '<img src="' . esc_url($header_img) . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . esc_attr($header_title) . '" />' . "\n"; } if (0 && display_header_text()) { $text_color = get_header_textcolor(); if ($text_color != get_theme_support('custom-header', 'default-text-color')) { echo '<style type="text/css" id="mh-header-css">'; echo '.logo-title, .logo-tagline { color: #' . esc_attr($text_color) . '; }'; echo '</style>' . "\n"; } echo '<div class="logo">' . "\n"; if ($header_title) { echo '<h1 class="logo-title">' . esc_attr($header_title) . '</h1>' . "\n"; } if ($header_desc) { echo '<h2 class="logo-tagline">' . esc_attr($header_desc) . '</h2>' . "\n"; } echo '</div>' . "\n"; } echo '</div>' . "\n"; echo '</a>' . "\n"; }
/** * Styles the header image and text displayed on the blog * * @see kopa_custom_header_setup(). * */ function kopa_header_style() { $text_color = get_header_textcolor(); // If no custom color for text is set, let's bail. if (display_header_text() && $text_color === get_theme_support('custom-header', 'default-text-color')) { return; } // If we get this far, we have custom styles. ?> <style type="text/css" id="kopa-header-css"> <?php // Has the text been hidden? if (!display_header_text()) { ?> .site-title { clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); position: absolute; } <?php // If the user has set a custom color for the text, use that. } elseif ($text_color != get_theme_support('custom-header', 'default-text-color')) { ?> .site-title a { color: #<?php echo esc_attr($text_color); ?> ; } <?php } ?> </style> <?php }
/** * Styles the header image and text displayed on the blog. * * @see artfolio_custom_header_setup(). */ function artfolio_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 (HEADER_TEXTCOLOR === $header_text_color) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css"> <?php // Has the text been hidden? if (!display_header_text()) { ?> .site-title,.site-description {position: absolute;clip: rect(1px, 1px, 1px, 1px);} <?php // If the user has set a custom color for the text use that. } else { ?> .site-title a, .site-description { color: #<?php echo esc_attr($header_text_color); ?> ; } <?php } ?> </style> <?php }
function wpt_style_header() { $text_color = get_header_textcolor(); ?> <style type="text/css"> #header .site-title a { color: #<?php echo esc_attr($text_color); ?> ; } <?php if (display_header_text() != true) { ?> .site-title { display: none; } <?php } ?> </style> <?php }
function mh_logo() { $header_img = get_header_image(); $header_title = get_bloginfo('name'); $header_desc = get_bloginfo('description'); echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr($header_title) . '" rel="home">' . "\n"; echo '<div class="logo-wrap" role="banner">' . "\n"; if ($header_img) { echo '<img src="' . esc_url($header_img) . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . esc_attr($header_title) . '" />' . "\n"; } if (display_header_text()) { $header_img ? $logo_pos = 'logo-overlay' : ($logo_pos = 'logo-text'); $text_color = get_header_textcolor(); if ($text_color != get_theme_support('custom-header', 'default-text-color')) { echo '<style type="text/css" id="mh-header-css">'; echo '.logo-name, .logo-desc { color: #' . esc_attr($text_color) . '; }'; echo '.logo-name { border-bottom: 3px solid #' . esc_attr($text_color) . '; }'; echo '</style>' . "\n"; } echo '<div class="logo ' . $logo_pos . '">' . "\n"; if ($header_title) { echo '<h1 class="logo-name">' . esc_attr($header_title) . '</h1>' . "\n"; } if ($header_desc) { echo '<h2 class="logo-desc">' . esc_attr($header_desc) . '</h2>' . "\n"; } echo '</div>' . "\n"; } echo '</div>' . "\n"; echo '</a>' . "\n"; }
function the_header() { $text = ''; $image = get_header_image(); $text = ' <div id="site-heading"> <h1 class="site-title"><a href="' . esc_url(home_url('/')) . '">' . get_bloginfo('name') . '</a></h1> <div class="site-description">' . get_bloginfo('description') . '</div> </div>'; if ($image) { $image = '<img src="' . esc_url($image) . '" />'; if (!display_header_text()) { $image = '<a href="' . esc_url(home_url('/')) . '">' . $image . '</a>'; } $image = '<div id="site-image">' . $image . '</div>'; } // Allow plugins/themes to override the default header. $output = apply_filters('fastfood_header', $text . $image); ?> <div id="site-header" role="banner"> <?php echo $output; ?> </div> <?php }
/** * Styles the header image and text displayed on the blog * * @see chuchadon_custom_header_setup(). */ function chuchadon_header_style() { /* Header text color. */ $header_color = get_header_textcolor(); /* Header image. */ $header_image = esc_url(get_header_image()); /* Start header styles. */ $style = ''; /* Header image height. */ $header_height = get_custom_header()->height; /* Header image width. */ $header_width = get_custom_header()->width; /* When to show header image. */ $min_width = absint(apply_filters('chuchadon_header_bg_show', 800)); $background_arguments = esc_attr(apply_filters('chuchadon_header_bg_arguments', 'no-repeat')); if (!empty($header_image)) { $style .= "@media screen and (min-width: {$min_width}px) { body.custom-header-image .site-header { background: url({$header_image}) {$background_arguments}; -webkit-background-size: 50%; -moz-background-size: 50%; -o-background-size: 50%; background-size: 50%; } }"; } /* Site title styles. */ if (display_header_text()) { $style .= ".home-title a { color: #{$header_color} }"; } if (!display_header_text()) { $style .= ".home-title, .home-description { clip: rect(1px, 1px, 1px, 1px); position: absolute; height: 1px; width: 1px; overflow: hidden; }"; } /* Echo styles if it's not empty. */ if (!empty($style)) { echo "\n" . '<style type="text/css" id="custom-header-css">' . trim($style) . '</style>' . "\n"; } }
/** * Styles the header image and text displayed on the blog * * @see caleighm_custom_header_setup(). */ function caleighm_header_style() { $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value. if (HEADER_TEXTCOLOR === $header_text_color) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css"> <?php // Has the text been hidden? if (!display_header_text()) { ?> .site-branding { position: absolute; clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text use that. } else { ?> .site-branding { color: #<?php echo esc_attr($header_text_color); ?> ; } <?php } ?> </style> <?php }
function ds_add_top_header() { $enable_header_top = esc_attr(get_theme_mod('dt_enable_header_top', DT_ENABLE_HEADER_TOP)); if ($enable_header_top != '1') { return; } ?> <div class="ds-top-header"> <div class="container"> <div class="ds-top-header-inner"> <div class="ds-top-head-left"> <?php if (display_header_text()) { echo get_bloginfo('description', 'display'); } ?> </div> <div class="ds-top-head-right"> <?php wp_nav_menu(array('theme_location' => 'header-top', 'container_class' => 'header_top_menu', 'menu_class' => 'ds-top-menu-ul')); ?> </div> </div> </div> </div> <?php }
/** * Styles the header image and text displayed on the blog * * This function handles BOTH previewing in the customizer as well as the actual display * of the header in the front-end. This function ONLY needs to handle hiding or displaying * the site title and custom header text color. All other styles are from the front-end * CSS. * * @see xsbf_custom_header_setup(). */ function xsbf_header_style() { // get_header_textcolor() returns 'blank' if hiding site title and tagline or returns // any hex color value. HEADER_TEXTCOLOR is always the default color. $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail if (HEADER_TEXTCOLOR == $header_text_color and !display_header_text()) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css"> <?php // Has the text been hidden? if ('blank' == $header_text_color) { ?> .site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); } .navbar-brand { position: relative; clip: auto; } <?php // If the user has set a custom color for the text use that } elseif (HEADER_TEXTCOLOR != $header_text_color) { ?> .site-title a, .site-description { color: #<?php echo $header_text_color; ?> ; } .site-title a:hover, .site-title a:active, .site-title a:focus { opacity: 0.75; } <?php } ?> <?php if (display_header_text()) { ?> .navbar-brand { position: absolute; clip: rect(1px, 1px, 1px, 1px); } <?php } ?> </style> <?php }
/** * Styles the header image and text displayed on the blog */ function apostrophe_header_style() { $header_image = get_header_image(); $text_color = get_header_textcolor(); /* Output the CSS for our custom styles */ ?> <style type="text/css" id="apostrophe-header-css"> <?php /* Do we have a custom header image? */ if ('' !== get_header_image()) { ?> .site-branding { background: url('<?php echo esc_url(get_header_image()); ?> ') center center; background-size: cover; min-height: 200px; padding: 3em; } <?php } /* Has the text been hidden? */ if (!display_header_text()) { ?> .site-title, .site-description { clip: rect(1px, 1px, 1px, 1px); position: absolute; } .site-branding { text-align: center; } .site-logo { float: none; margin-top: 0; margin-bottom: 3.5px; } <?php /* If the user has set a custom color for the text, use that. */ } elseif (get_theme_support('custom-header', 'default-text-color') !== $text_color) { ?> .site-title a, .site-description { color: #<?php echo esc_attr($text_color); ?> ; } <?php } ?> </style> <?php }
function header_text_display() { // Has the text been hidden? if (display_header_text() == 1) { return "inline-block"; } else { return "none"; } }
/** * Load appropriate header styles * @return null */ function arras_header_style() { $header_image = get_header_image(); $text_color = get_header_textcolor(); // If no custom options for text are set, let's bail. if (empty($header_image) && $text_color == get_theme_support('custom-header', 'default-text-color')) { return; } // If we get this far, we have custom styles. ?> <style type="text/css" id="custom-header-css"> <?php if (!empty($header_image)) { ?> #branding { background: url(<?php header_image(); ?> ) no-repeat scroll left; background-size: cover; } <?php } // Has the text been hidden? if (!display_header_text()) { ?> .site-title, .site-description { position: absolute; clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); } <?php if (empty($header_image)) { ?> .site-header .home-link { min-height: 0; } <?php } // If the user has set a custom color for the text, use that. } elseif ($text_color != get_theme_support('custom-header', 'default-text-color')) { ?> .site-title, .site-description { color: #<?php echo esc_attr($text_color); ?> ; } <?php } ?> </style> <?php }
/** * Adds custom classes to the array of body classes. */ function motif_body_classes($classes) { if (!is_multi_author()) { $classes[] = 'not-multi-author'; } if (display_header_text()) { $classes[] = 'display-header-text'; } return $classes; }
/** * Styles the header image and text displayed on the blog. * * @since Twenty Fifteen 1.0 * * @see foundation_custom_header_setup() */ function foundation_header_style() { $header_image = get_header_image(); // If no custom options for text are set, let's bail. if (empty($header_image) && !display_header_text()) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css" id="foundation-header-css"> <?php // Has a Custom Header been added? if (!empty($header_image)) { ?> #homepage-hero { /* * No shorthand so the Customizer can override individual properties. * @see https://core.trac.wordpress.org/ticket/31460 */ background-image: url(<?php header_image(); ?> ); } <?php } ?> <?php // Has the text been hidden? if (!display_header_text()) { ?> .site-branding{ position: absolute; clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text, use that. } else { ?> .site-branding, .site-branding a{ color:#<?php echo get_header_textcolor(); ?> ; } <?php } ?> </style> <?php }
function kai_12_header_style() { if (!display_header_text()) { ?> <style type="text/css" id="kai-12-header-css"> .site-header hgroup { display: none; } </style> <?php } }
/** * Styles the header image and text displayed on the blog * * @see bushwick_custom_header_setup(). */ function bushwick_header_style() { $header_image = get_header_image(); $text_color = get_header_textcolor(); if (is_singular(array('post', 'page'))) { $attachment = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); $header_image = empty($attachment[0]) ? $header_image : $attachment[0]; } // If no custom options for text are set, let's bail. if (empty($header_image) && $text_color == get_theme_support('custom-header', 'default-text-color')) { return; } // If we get this far, we have custom styles. ?> <style type="text/css"> <?php if (!empty($header_image)) { ?> .site-header { background: rgba(51, 71, 61, 0.05) url(<?php echo esc_url($header_image); ?> ) no-repeat scroll center; background-size: cover; } <?php } // Has the text been hidden? if (!display_header_text()) { ?> .site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); left: -1000em; } <?php // If the user has set a custom color for the text use that. } elseif ($text_color != get_theme_support('custom-header', 'default-text-color')) { ?> .site-header .site-title, .site-header .site-description { color: #<?php echo $text_color; ?> ; } <?php } ?> </style> <?php }
function wpforge_header_style() { ?> <style type="text/css" id="wpforge-custom-header-css"><?php if (!display_header_text()) { ?> .site-title,.site-title h1 a,.site-description{display:none;}<?php } ?> </style> <?php }
/** * Callback function for outputting the custom header CSS to `wp_head`. * * @since 1.0.0 * @access public * @return void */ function stargazer_custom_header_wp_head() { if (!display_header_text()) { return; } $hex = get_header_textcolor(); if (!$hex) { return; } $style = "body.custom-header #site-title a { color: #{$hex}; }"; echo "\n" . '<style type="text/css" id="custom-header-css">' . trim($style) . '</style>' . "\n"; }
function material_gaze_custom_header_wp_head() { if (!display_header_text()) { return; } $hex = get_header_textcolor(); if (empty($hex)) { return; } $style = "body.custom-header #branding, #site-title { color: #{$hex}; }"; echo "\n" . '<style type="text/css" id="custom-header-css">' . trim($style) . '</style>' . "\n"; }
/** * Styles the header image and text displayed on the blog. * * @see octopus_custom_header_setup(). */ function octopus_header_style() { $header_text_color = get_header_textcolor(); // If no custom options are set, let's bail. if (!get_theme_mods()) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css" id="octopus-custom-style"> <?php /* * 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 (!HEADER_TEXTCOLOR === $header_text_color) { // Has the text been hidden? if (!display_header_text()) { ?> .site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text use that. } else { ?> .site-title a, .site-description { color: #<?php echo esc_attr($header_text_color); ?> ; } <?php } ?> <?php } ?> <?php octopus_generate_css('#page.container', 'max-width', 'container_max_width', '', '', true); //Header octopus_generate_css('.container-fluid .octopus-wrapper', 'max-width', 'wrapped_element_max_width', '', 'px', true); // Header banner octopus_generate_css('.octopus-header-banner', 'height', 'header_banner_height', '', 'px', true); ?> </style> <?php }
function travel_stories_header_style() { $text_color = get_header_textcolor(); $display_text = display_header_text(); ?> <?php if ($text_color == HEADER_TEXTCOLOR) { /* If no custom options for text are set, return default. */ return; } /* If optins are set, we use them */ ?> <style type="text/css"> /* Set custom header background */ .travel-stories-header-head { background: url('<?php header_image(); ?> ') no-repeat top center; } <?php if ('blank' != $text_color) { ?> .travel-stories-logo-text h1 a, #site-description, .travel-stories-logo-text-post h1 a { color: # <?php echo $text_color; ?> !important; } <?php } if (!$display_text) { /* Display text or not */ ?> .travel-stories-logo-text h1 a, .travel-stories-logo-text-post h1 a, #site-description { display: none; } <?php } ?> </style> <?php }
function cleansimplewhite_header_style() { $header_image = get_header_image(); ?> <style> #header a:link, #header a:visited { color: <?php echo get_theme_mod('header_link_color'); ?> !important; } #header div { color: <?php echo get_theme_mod('header_text_color'); ?> !important; } <?php if (!empty($header_image)) { ?> #header { background-image: url(<?php echo $header_image; ?> ); height: <?php echo get_custom_header()->height; ?> px; } <?php } ?> <?php if (!display_header_text()) { ?> #header * { text-indent: -9999px; } <?php } ?> </style> <?php }
/** * Add header-* classes to the body class. * * We can use pseudo-variables in our CSS file, which helps us achieve multiple header layouts with minimal code. * * @since 0.2.2 * * @param array $classes Existing body classes. * @return array Amended body classes. */ function genesis_header_body_classes(array $classes) { if (current_theme_supports('custom-header')) { if (get_theme_support('custom-header', 'default-text-color') !== get_header_textcolor() || get_theme_support('custom-header', 'default-image') !== get_header_image()) { $classes[] = 'custom-header'; } } if ('image' === genesis_get_option('blog_title') || get_header_image() && !display_header_text()) { $classes[] = 'header-image'; } if (!is_active_sidebar('header-right') && !has_action('genesis_header_right')) { $classes[] = 'header-full-width'; } return $classes; }
function wpt_style_header() { $text_color = get_header_textcolor(); ?> <style type="text/css"> #header .site-title a { color: #<?php echo esc_attr($text_color); ?> ; } <?php if (display_header_text() != true) { ?> .site-title, .site-description { display: none; } <?php } ?> h1 { font-size: <?php echo get_theme_mod('wpt_h1_font_size'); ?> ; } h1 a { color: <?php echo get_theme_mod('wpt_h1_color'); ?> ; } <?php if (get_theme_mod('wpt_custom_css') != '') { echo get_theme_mod('wpt_custom_css'); } ?> </style> <?php }
/** * Style the header text displayed on the blog. * * @since IS Simple 1.0 * ---------------------------------------------------------------------------- */ function issimple_header_style() { $header_image = get_header_image(); $text_color = get_header_textcolor(); // If no custom options for text are set, let's bail. if (!$text_color && empty($header_image)) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css" id="issimple-header-css"> <?php // Has a Custom Header been added? if (!empty($header_image)) { ?> #fixed-nav-header { background: url(<?php header_image(); ?> ) no-repeat scroll top center; background-size: 100% auto; } <?php } // Has the text been visible? if (display_header_text()) { ?> #name a { color: #<?php echo esc_attr($text_color); ?> ; } <?php } // Has the text been hidden? if (!display_header_text()) { ?> #header-txt { clip: rect(1px, 1px, 1px, 1px); position: absolute !important; } <?php } ?> </style> <?php }
/** * Adds custom classes to the array of body classes. */ function sela_body_classes($classes) { if (is_page_template('full-width-page.php') || is_page_template('grid-page.php')) { $classes[] = 'full-width-page'; } if (!is_multi_author()) { $classes[] = 'not-multi-author'; } if (!is_active_sidebar('sidebar-1')) { $classes[] = 'no-sidebar'; } if (display_header_text()) { $classes[] = 'display-header-text'; } if (is_page() && !comments_open() && '0' == get_comments_number()) { $classes[] = 'comments-closed'; } return $classes; }
function mh_magazine_lite_custom_header() { $header_img = get_header_image(); $header_title = get_bloginfo('name'); $header_tagline = get_bloginfo('description'); echo '<div class="mh-custom-header" role="banner">' . "\n"; echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr(get_bloginfo('name')) . '" rel="home">' . "\n"; echo '<div class="mh-site-logo" role="banner">' . "\n"; if ($header_img) { echo '<img class="mh-header-image" src="' . esc_url($header_img) . '" height="' . esc_attr(get_custom_header()->height) . '" width="' . esc_attr(get_custom_header()->width) . '" alt="' . esc_attr($header_title) . '" />' . "\n"; } if (display_header_text()) { $header_text_color = get_header_textcolor(); if ($header_text_color != get_theme_support('custom-header', 'default-text-color')) { echo '<style type="text/css" id="mh-header-css">'; echo '.mh-header-title, .mh-header-tagline { color: #' . esc_attr($header_text_color) . '; }'; echo '</style>' . "\n"; } echo '<div class="mh-header-text">' . "\n"; if (is_front_page()) { $header_title_before = '<h1 class="mh-header-title">'; $header_title_after = '</h1>' . "\n"; $header_tagline_before = '<h2 class="mh-header-tagline">'; $header_tagline_after = '</h2>' . "\n"; } else { $header_title_before = '<h2 class="mh-header-title">'; $header_title_after = '</h2>' . "\n"; $header_tagline_before = '<h3 class="mh-header-tagline">'; $header_tagline_after = '</h3>' . "\n"; } if ($header_title) { echo $header_title_before . esc_attr($header_title) . $header_title_after; } if ($header_tagline) { echo $header_tagline_before . esc_attr($header_tagline) . $header_tagline_after; } echo '</div>' . "\n"; } echo '</div>' . "\n"; echo '</a>' . "\n"; echo '</div>' . "\n"; }
/** * Styles the header image and text displayed on the blog * * @see reyl_lite_custom_header_setup(). */ function reyl_lite_header_style() { $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value. if (HEADER_TEXTCOLOR === $header_text_color) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css"> <?php // Has the text been hidden? if (!display_header_text()) { ?> .logo_container .ql_logo, .logo_container .site-description{ position: absolute; clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text use that. } else { ?> .logo_container .ql_logo, .logo_container .site-description { color: #<?php echo esc_attr($header_text_color); ?> ; } #primary-menu a { color: #<?php echo esc_attr($header_text_color); ?> ; opacity: 0.8; } <?php } ?> </style> <?php }
function render() { $style = "\n"; $url = $this->get_header_image(); if ($url) { $style .= ".block-0 {\n\t\t\t\tbackground-image:url({$url});\n\t\t\t}\n"; } $style .= ".block-0 > h1 {\n"; if (!display_header_text()) { $style .= "\tdisplay: none;\n"; } else { $style .= "\tcolor: #" . get_header_textcolor() . ";\n"; } $style .= "}\n"; ?> <style><?php echo $style; ?> </style><?php }