scss 创世记条目标题横幅

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss 创世记条目标题横幅相关的知识,希望对你有一定的参考价值。

/**
 * These are convenience functions
 */
function gs_remove_entry_title()
{
    remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
    remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}

function gs_entry_title( $func ) {
    add_action( 'genesis_after_header', $func );
}


gs_entry_title( 'gs_do_entry_title' );
function gs_do_entry_title()
{
	/*
	 * We do not want to modify the home or front page title, 
	 */

	if ( is_home() || is_front_page() ) {
		return;
	}

	/**
	 * Default use the normal title
	 */
	$title = get_the_title();
	$class = 'entry-title';

	/**
	 * Let's see if there is a custom field type to tell us
	 * what entry title to use..
	 */


	/* 
	 * If this is a single post or a page we want to take the 
	 * title of the post / page for our banner.
	 *
	 * If we are viewing a category or archive of some type, we
	 * want to take the title from that archive.
	 *
	 * I really need to create a unique 404 page.
	 */
	if ( is_single() || is_page() ) {

		gs_remove_entry_title();
		$title = get_the_title();

		$class .= ' single';

	} else if ( is_author() ) {

		$title = get_the_author();

		$class .= ' author';

	} else if ( is_category() || is_archive() ) {

		$class .= ' archive';

		$cats = get_the_category();
		$cat = $cats[0];
		$title = $cat->name;

	} else if ( is_404() ) {

		$title = "Ooops! I don't know what your looking for...";
		$class .= ' c404';
	}

	?>

	<!-- Header banner on the main page -->
	<header class='<?php echo $class ?>'>
		<h1><?php echo $title; ?></h1>
	</header>

	<?php
}


@mixin title-darkener($start-color:#f7f7f7, $howmuch:15%) {
	$end-color: darken( $start-color, $howmuch );
   	@include radial-gradient( $start-color, $end-color );
	border-bottom: 1px solid darken( $start-color, $howmuch / 2 );
}

@mixin title-background($start-color:#f7f7f7, $end-color:#d2d2d2) {
   	@include radial-gradient( $start-color, $end-color );
	border-bottom: 1px solid darken( $end-color, 80% );
}

/**
 * Move the entry title just under the navbar and give it a 
 * cool background color to set it apart.
 */
$banner-background-default: #f7f7f7;
$banner-background-404: #F76C37;

header.entry-title {
	padding: 30px 0;

   	@include title-darkener( $banner-background-default );

	&.c404 {
		background: $banner-background-404;
		@include title-background( #FFC051, $banner-background-404 );
	}

	h1 {
		@include wrap;
		color: black;
		margin-bottom: 0;
		text-align: center;
	}
}

以上是关于scss 创世记条目标题横幅的主要内容,如果未能解决你的问题,请参考以下文章

php 创世记摘录。

php 创世记中的编号评论分页

php 更改创世记中的页脚文本 - Nick Keeping

python 安德烈·卡尔帕西(Andrej Karpathy)在“创世记”第一章中训练char_rnn

scss SCSS:带边​​缘切口的横幅

scss 404页面横幅图像修复