当前位置: 首页>>代码示例>>PHP>>正文


PHP display_header_text函数代码示例

本文整理汇总了PHP中display_header_text函数的典型用法代码示例。如果您正苦于以下问题:PHP display_header_text函数的具体用法?PHP display_header_text怎么用?PHP display_header_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了display_header_text函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mh_newsdesk_lite_logo

 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";
 }
开发者ID:rafaelnco,项目名称:tiamaria,代码行数:29,代码来源:mh-custom-functions.php

示例2: kopa_header_style

    /**
     * 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 
    }
开发者ID:JeremyChristian,项目名称:webasr2,代码行数:41,代码来源:custom-header.php

示例3: artfolio_header_style

    /**
     * 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 
    }
开发者ID:kkowatsch,项目名称:Yeoman,代码行数:40,代码来源:custom-header.php

示例4: wpt_style_header

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 
}
开发者ID:kirandash,项目名称:bijithemecustomizer,代码行数:27,代码来源:functions.php

示例5: mh_logo

 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";
 }
开发者ID:davidHuanghw,项目名称:david_blog,代码行数:31,代码来源:mh-custom-functions.php

示例6: the_header

    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 
    }
开发者ID:TwoBeers,项目名称:fastfood,代码行数:30,代码来源:custom-header.php

示例7: chuchadon_header_style

 /**
  * 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";
     }
 }
开发者ID:samikeijonen,项目名称:chuchadon,代码行数:35,代码来源:custom-header.php

示例8: caleighm_header_style

    /**
     * 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 
    }
开发者ID:caleighm,项目名称:FirstWPTheme,代码行数:40,代码来源:custom-header.php

示例9: ds_add_top_header

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 
}
开发者ID:mistergiri,项目名称:directory-starter,代码行数:27,代码来源:custom.php

示例10: xsbf_header_style

    /**
     * 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 
    }
开发者ID:shabbirvividads,项目名称:tauch-terminal,代码行数:68,代码来源:custom-header.php

示例11: apostrophe_header_style

    /**
     * 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 
    }
开发者ID:glugpace,项目名称:glugpace.org,代码行数:60,代码来源:custom-header.php

示例12: header_text_display

function header_text_display()
{
    // Has the text been hidden?
    if (display_header_text() == 1) {
        return "inline-block";
    } else {
        return "none";
    }
}
开发者ID:ToddHedrick,项目名称:altadenadesigns,代码行数:9,代码来源:functions.php

示例13: arras_header_style

/**
 * 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 
}
开发者ID:LightDestory,项目名称:arras,代码行数:60,代码来源:custom-header.php

示例14: motif_body_classes

/**
 * 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;
}
开发者ID:mrbadao,项目名称:automatic,代码行数:13,代码来源:extras.php

示例15: foundation_header_style

    /**
     * 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 
    }
开发者ID:adam1920,项目名称:FoundationTheme,代码行数:61,代码来源:custom-header.php


注:本文中的display_header_text函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。