css 用内联徽标替换标题网站标题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 用内联徽标替换标题网站标题相关的知识,希望对你有一定的参考价值。

.site-title img {
	vertical-align: top;
}
.site-title a, .site-title a:hover {
	padding: 0;
}

.site-title img {
	vertical-align: top;
}
.site-title img {
	vertical-align: top;
}

.title-area {
	padding-top: 0;
}
//* Remove the site description
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
//* Add support for custom header
add_theme_support( 'custom-header', array(
	'width'           => 260,
	'height'          => 100,
	'header-selector' => '.site-title a',
	'header-text'     => false
) );
.header-image .site-title > a {
	background: transparent;
}

.header-image .site-title {
	text-indent: 0;
}

.site-title img {
	vertical-align: top;
}

.title-area {
	padding: 0;
}
<?php
//* Do NOT include the opening php tag

/**********************************
 *
 * Replace Header Site Title with Inline Logo
 *
 * Fixes Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
 *
 * Replaces "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
 *
 * @author AlphaBlossom / Tony Eppright
 * @link http://www.alphablossom.com/a-better-wordpress-genesis-responsive-logo-header/
 *
 * @edited by Sridhar Katakam
 * @link http://www.sridharkatakam.com/use-inline-logo-instead-background-image-genesis/
 *
************************************/
add_filter( 'genesis_seo_title', 'custom_header_inline_logo', 10, 3 );
function custom_header_inline_logo( $title, $inside, $wrap ) {

	$logo = '<img src="' . get_stylesheet_directory_uri() . '/images/logo.gif" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '" title="' . esc_attr( get_bloginfo( 'name' ) ) . '">';

	$inside = sprintf( '<a href="%s" title="%s">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $logo );

	//* Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
	$wrap = is_front_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';

	//* A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
	$wrap = is_front_page() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;

	//* And finally, $wrap in h1 if HTML5 & semantic headings enabled
	$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;

	return sprintf( '<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr( 'site-title' ), $inside );

}
.title-area {
	padding-top: 10px;
}

.site-title {
	margin-bottom: 0;
}

.site-title a, .site-title a:hover {
	padding-top: 0;
}

a img {
	margin-bottom: 0;
}

.site-title a img {
	vertical-align: top;
}
a img {
	margin-bottom: 0;
}

.site-title a img {
	vertical-align: top;
}

以上是关于css 用内联徽标替换标题网站标题的主要内容,如果未能解决你的问题,请参考以下文章

css 出于SEO原因,将h1替换为徽标。

使用媒体查询进行移动优化的背景而不是内联图像?

在 Wordpress 中通过 CSS 将徽标居中

css 这会隐藏发票左上角的文本,并将其替换为全宽打印输出徽标。

php PHP Minify(http://code.google.com/p/minify)后处理帮助程序类用内联数据替换小CSS图像。这减少了nu

powershell PowerShell脚本,用于替换Web应用程序中网站集中所有网站中的所有徽标。