本文整理汇总了PHP中get_custom_header函数的典型用法代码示例。如果您正苦于以下问题:PHP get_custom_header函数的具体用法?PHP get_custom_header怎么用?PHP get_custom_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_custom_header函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: chaostheory_setup
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*/
function chaostheory_setup()
{
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on chaostheory, use a find and replace
* to change 'chaostheory' to the name of your theme in all the template files
*/
load_theme_textdomain('chaostheory', get_template_directory() . '/languages');
/**
* Add default posts and comments RSS feed links to head
*/
add_theme_support('automatic-feed-links');
/**
* Enable support for Post Thumbnails on posts and pages
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support('post-thumbnails');
set_post_thumbnail_size(get_custom_header()->width, get_custom_header()->height, true);
/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus(array('primary' => __('Primary Navigation', 'chaostheory')));
}
开发者ID:darrylivan,项目名称:caraccidentlawyerflagstaff.com,代码行数:32,代码来源:functions.php
示例2: cc_add_header_image
function cc_add_header_image()
{
global $post;
$header_image = get_header_image();
$custom_header_image = get_custom_header();
/*echo '<!-- debug: header_image ' . print_r( array('header_image' => $header_image, 'custom_header_image' => $custom_header_image ), true ). ' -->';*/
if (!empty($header_image)) {
?>
<div class="cc-header-image">
<a class="cc-header-image-link" href="<?php
echo esc_url(home_url('/'));
?>
" title="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home">
<img src="<?php
echo $header_image;
?>
" width="<?php
echo $custom_header_image->width;
?>
" height="<?php
echo $custom_header_image->height;
?>
" alt="">
</a>
</div>
<?php
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:31,代码来源:template-tags.php
示例3: 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
示例4: 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
示例5: colormag_render_header_image
/**
* Shows the small info text on top header part
*/
function colormag_render_header_image()
{
$header_image = get_header_image();
if (!empty($header_image)) {
if (get_theme_mod('colormag_header_image_link', 0) == 1) {
?>
<a href="<?php
echo esc_url(home_url('/'));
?>
" title="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home">
<?php
}
?>
<div class="header-image-wrap"><img src="http://thevrforums.com/images/banner.png" class="header-image" width="<?php
echo get_custom_header()->width;
?>
" height="<?php
echo get_custom_header()->height;
?>
" alt="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
"></div>
<?php
if (get_theme_mod('colormag_header_image_link', 0) == 1) {
?>
</a>
<?php
}
}
}
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:37,代码来源:header-functions.php
示例6: magik_custom_header_wp_head
/**
* Callback function for outputting the custom header CSS to `wp_head`.
*
* @since 1.0.0
* @access public
* @return void
*/
function magik_custom_header_wp_head()
{
$header_image = get_header_image();
$style = "body.custom-header #branding { }";
$style = sprintf('body.custom-header #branding { background: url(%1$s) center center no-repeat !important; text-indent: -9999px;background-size: %2$dpx %3$dpx !important; min-height: %3$dpx}', esc_url($header_image), absint(get_custom_header()->width / 2), absint(get_custom_header()->height / 2));
echo "\n" . '<style type="text/css" id="custom-header-css">' . trim($style) . '</style>' . "\n";
}
开发者ID:MagikPress,项目名称:magik,代码行数:14,代码来源:custom-header.php
示例7: franz_header_image
/**
* Creates the tag for header image
*/
function franz_header_image()
{
$header = get_custom_header();
if ($header->url) {
/* Scale hidpi header image */
$custom_header = get_theme_support('custom-header');
$header_args = array_pop($custom_header);
if ($header->width >= 2 * $header_args['width']) {
$header->width = floor($header->width / 2);
$header->height = floor($header->height / 2);
}
?>
<img class="img-responsive" src="<?php
echo esc_url($header->url);
?>
" height="<?php
echo esc_attr($header->height);
?>
" width="<?php
echo esc_attr($header->width);
?>
" alt="" />
<?php
} else {
bloginfo('name');
}
}
开发者ID:aragonc,项目名称:chamiluda,代码行数:31,代码来源:header.php
示例8: 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
示例9: encounters_lite_admin_header_image
/**
* Outputs markup to be displayed on the Appearance > Header admin panel.
* This callback overrides the default markup displayed there.
*
*/
function encounters_lite_admin_header_image()
{
?>
<div id="headimg">
<?php
$header_image = get_header_image();
if (!empty($header_image)) {
?>
<img src="<?php
echo esc_url($header_image);
?>
" class="header-image" width="<?php
echo get_custom_header()->width;
?>
" height="<?php
echo get_custom_header()->height;
?>
" alt="" />
<?php
}
?>
</div>
<?php
}
开发者ID:double360,项目名称:wordpress,代码行数:30,代码来源:custom-header.php
示例10: contango_admin_header_image
/** Styles the header image and text displayed on the blog preview. */
function contango_admin_header_image()
{
?>
<div id="headimg">
<?php
if (get_header_image()) {
?>
<div id="logo-image">
<a href="<?php
echo esc_url(home_url('/'));
?>
" onclick="return false;"><img src="<?php
header_image();
?>
" width="<?php
echo esc_attr(get_custom_header()->width);
?>
" height="<?php
echo esc_attr(get_custom_header()->height);
?>
" alt="<?php
bloginfo('name');
?>
" /></a>
</div><!-- end of #logo -->
<?php
} else {
// header image was removed
?>
<div id="logo-text">
<span class="site-name"><a href="<?php
echo esc_url(home_url('/'));
?>
" onclick="return false;" title="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home"><?php
bloginfo('name');
?>
</a></span>
<span class="site-description"><?php
bloginfo('description');
?>
</span>
</div><!-- end of #logo -->
<?php
}
// header image was removed (again)
?>
</div>
<?php
}
开发者ID:mystified7545,项目名称:MyBlog,代码行数:59,代码来源:custom-header.php
示例11: igthemes_header_branding
function igthemes_header_branding()
{
?>
<div class="site-branding col12">
<?php
if (get_header_image()) {
?>
<img src="<?php
header_image();
?>
" width="<?php
echo get_custom_header()->width;
?>
" height="<?php
echo get_custom_header()->height;
?>
" class="header-image">
<?php
}
// End header image check.
?>
<?php
if (igthemes_get_option('logo')) {
?>
<a href="<?php
echo esc_url(home_url('/'));
?>
" id="site-logo" title="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home">
<img src="<?php
echo esc_url(igthemes_get_option('logo'));
?>
" alt="<?php
echo esc_attr(bloginfo('name'));
?>
"></a>
<?php
} else {
?>
<h1 class="site-title">
<a href="<?php
echo esc_url(home_url('/'));
?>
" rel="home"><?php
bloginfo('name');
?>
</a>
</h1>
<?php
}
?>
</div><!-- .site-branding -->
<?php
}
开发者ID:etondeengole,项目名称:Store_Application,代码行数:56,代码来源:function-action.php
示例12: adelle_theme_heading
function adelle_theme_heading()
{
if (get_header_image() == true) {
?>
<a href="<?php
echo esc_url(home_url());
?>
">
<img src="<?php
header_image();
?>
" class="header-title" height="<?php
echo get_custom_header()->height;
?>
" width="<?php
echo get_custom_header()->width;
?>
" alt="<?php
bloginfo('name');
?>
" title="<?php
bloginfo('name');
?>
" />
</a>
<?php
} elseif (is_home() || is_front_page()) {
?>
<h1><a href="<?php
echo esc_url(home_url());
?>
" class="header-title"><?php
bloginfo('name');
?>
</a></h1>
<p class="header-desc"><?php
bloginfo('description');
?>
</p>
<?php
} else {
?>
<h5><a href="<?php
echo esc_url(home_url());
?>
" class="header-title"><?php
bloginfo('name');
?>
</a></h5>
<p class="header-desc"><?php
bloginfo('description');
?>
</p>
<?php
}
}
开发者ID:brstgt,项目名称:layuda,代码行数:56,代码来源:functions.php
示例13: ubersmake_custom_header_setup
function ubersmake_custom_header_setup()
{
$args = array('default-image' => '%2$s/images/headers/atrium.jpg', 'default-text-color' => '000', 'width' => apply_filters('pilcrow_header_image_width', 990), 'height' => apply_filters('pilcrow_header_image_height', 257), 'wp-head-callback' => 'pilcrow_header_style', 'admin-head-callback' => 'pilcrow_admin_header_style', 'admin-preview-callback' => 'pilcrow_admin_header_image');
$options = pilcrow_get_theme_options();
if (in_array($options['theme_layout'], array('content-sidebar', 'sidebar-content'))) {
$args['width'] = apply_filters('pilcrow_header_image_width', 770);
$args['height'] = apply_filters('pilcrow_header_image_height', 200);
}
add_theme_support('custom-header', apply_filters('pilcrow_custom_header_args', $args));
set_post_thumbnail_size(get_custom_header()->width, get_custom_header()->height, true);
register_default_headers(array('atrium' => array('url' => '%2$s/images/headers/atrium.jpg', 'thumbnail_url' => '%2$s/images/headers/atrium-thumbnail.jpg', 'description' => _x('Atrium', 'Header image description', 'ubersmake'), 'source' => 'https://www.flickr.com/photos/ubersmake/14967126893/'), 'cafe' => array('url' => '%2$s/images/headers/cafe.jpg', 'thumbnail_url' => '%2$s/images/headers/cafe-thumbnail.jpg', 'description' => _x('Cafe', 'Header image description', 'ubersmake'), 'source' => 'https://www.flickr.com/photos/ubersmake/15836437415/'), 'causeway' => array('url' => '%2$s/images/headers/causeway.jpg', 'thumbnail_url' => '%2$s/images/headers/causeway-thumbnail.jpg', 'description' => _x('Causeway', 'Header image description', 'ubersmake'), 'source' => 'https://www.flickr.com/photos/ubersmake/14975660961/'), 'edinburgh' => array('url' => '%2$s/images/headers/edinburgh.jpg', 'thumbnail_url' => '%2$s/images/headers/edinburgh-thumbnail.jpg', 'description' => _x('edinburgh', 'Header image description', 'ubersmake'), 'source' => 'https://www.flickr.com/photos/ubersmake/15062454096/'), 'paris' => array('url' => '%2$s/images/headers/paris.jpg', 'thumbnail_url' => '%2$s/images/headers/paris-thumbnail.jpg', 'description' => _x('Paris', 'Header image description', 'ubersmake'), 'source' => 'https://www.flickr.com/photos/ubersmake/15174505258/')));
}
开发者ID:Ubersmake,项目名称:Ubersmake.com-WordPress-Theme,代码行数:12,代码来源:functions.php
示例14: wp_enqueue_scripts
/**
* Enqueue our custom header styles/scripts
*
* @access public
*/
function wp_enqueue_scripts()
{
$hero = '#homepage-hero {';
$hero .= 'background-image:url(' . get_custom_header()->url . ');';
$hero .= 'background-color:' . get_theme_mod('header_bg_color') . ';';
$hero .= 'padding: 1.25rem 0;';
$hero .= 'margin: -2rem 0 2rem;';
$hero .= 'position: relative;';
$hero .= 'text-align: left;';
$hero .= 'height: auto;';
$hero .= '}';
$hero .= '#homepage-hero h1 a, #homepage-hero h4 {color:#' . get_header_textcolor() . '}';
wp_add_inline_style('app-css', $hero);
}
开发者ID:benlaud,项目名称:hatch,代码行数:19,代码来源:hatch-customheader.php
示例15: cleansimplewhite_header_style
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
}
开发者ID:pedroddf,项目名称:wordpress-bootstrap-theme,代码行数:50,代码来源:functions.php
示例16: mh_logo
function mh_logo()
{
$header_img = get_header_image();
echo '<div class="logo-wrap" role="banner">' . "\n";
if ($header_img) {
echo '<a href="' . esc_url(home_url('/')) . '" title="' . get_bloginfo('name') . '" rel="home"><img src="' . $header_img . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . get_bloginfo('name') . '" /></a>' . "\n";
} else {
echo '<div class="logo">' . "\n";
echo '<a href="' . esc_url(home_url('/')) . '" title="' . get_bloginfo('name') . '" rel="home">' . "\n";
echo '<h1 class="logo-name">' . get_bloginfo('name') . '</h1>' . "\n";
echo '<h2 class="logo-desc">' . get_bloginfo('description') . '</h2>' . "\n";
echo '</a>' . "\n";
echo '</div>' . "\n";
}
echo '</div>' . "\n";
}
开发者ID:Gabriel-07,项目名称:site,代码行数:16,代码来源:mh-custom-functions.php
示例17: listify_admin_header_style
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*
* @see listify_custom_header_setup().
*/
function listify_admin_header_style()
{
/* Supplimentary CSS */
wp_enqueue_style('listify-fonts', listify_fonts_url());
$header_image = get_custom_header();
?>
<style type="text/css">
.appearance_page_custom-header #headimg {
border: none;
background-color: <?php
echo listify_theme_mod('color-header-background');
?>
;
padding: 10px;
width: auto;
}
.appearance_page_custom-header #headimg img {
float: none;
display: inline-block;
vertical-align: middle;
}
#headimg h1 {
margin: 0 0 0 20px;
font-family: 'Montserrat', sans-serif;
font-size: 26px;
font-weight: normal;
display: inline-block;
vertical-align: middle;
}
#headimg h1 a {
text-decoration: none;
}
#desc {
display: none;
}
#headimg img {
float: left;
}
</style>
<?php
}
开发者ID:abdullahrahim,项目名称:shadighar,代码行数:51,代码来源:custom-header.php
示例18: independent_publisher_site_info
function independent_publisher_site_info()
{
?>
<?php
if (get_header_image()) {
?>
<a class="site-logo" href="<?php
echo esc_url(home_url('/'));
?>
" title="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home">
<img class="no-grav" src="<?php
echo esc_url(get_header_image());
?>
" height="<?php
echo absint(get_custom_header()->height);
?>
" width="<?php
echo absint(get_custom_header()->width);
?>
" alt="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
" />
</a>
<?php
}
?>
<h1 class="site-title">
<a href="<?php
echo esc_url(home_url('/'));
?>
" title="<?php
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home">Africa <span class="orangeHighlight">Rizing</span></a>
</h1>
<h2 class="site-description"><?php
bloginfo('description');
?>
</h2>
<?php
get_template_part('menu', 'social');
}
开发者ID:BBGInnovate,项目名称:rizeWP,代码行数:46,代码来源:functions.php
示例19: admin_header_style
/**
* 管理ページ、カスタムヘッダーのスタイル
*/
function admin_header_style()
{
?>
<style type="text/css">
#headimg {
max-width: <?php
echo get_custom_header()->width;
?>
px;
height: <?php
echo get_custom_header()->height;
?>
px;
}
</style>
<?php
}
开发者ID:ayumuWorks,项目名称:Website,代码行数:20,代码来源:functions.php
示例20: teaberry_admin_header_image
/**
* output markup to be displayed in the admin panel
*/
function teaberry_admin_header_image()
{
?>
<div id="headimg">
<?php
$image = get_header_image();
if (!empty($image)) {
$header = array('image' => esc_url($image), 'class' => 'header-image', 'width' => get_custom_header()->width, 'height' => get_custom_header()->height);
vprintf('<img src="%s" class="%s" width="%s" height="%s" alt="" />', $header);
}
?>
</div>
<?php
}
开发者ID:honeymustard,项目名称:teaberry,代码行数:21,代码来源:header.php
注:本文中的get_custom_header函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论