improving

This commit is contained in:
Keitaroh Kobayashi 2013-08-07 18:43:53 +09:00
parent 1c902ded81
commit 5bbc7e0d10
10 changed files with 15 additions and 286 deletions

View File

@ -45,19 +45,6 @@ function wp386_setup() {
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'wp386' ),
) );
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
/**
* Setup the WordPress core custom background feature.
*/
add_theme_support( 'custom-background', apply_filters( 'wp386_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif; // wp386_setup
add_action( 'after_setup_theme', 'wp386_setup' );
@ -110,11 +97,6 @@ function wp386_scripts() {
}
add_action( 'wp_enqueue_scripts', 'wp386_scripts' );
/**
* Implement the Custom Header feature.
*/
//require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/

View File

@ -1,129 +0,0 @@
<?php
/**
* Sample implementation of the Custom Header feature
* http://codex.wordpress.org/Custom_Headers
*
* You can add an optional custom header image to header.php like so ...
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
</a>
<?php } // if ( ! empty( $header_image ) ) ?>
*
* @package _s
*/
/**
* Setup the WordPress core custom header feature.
*
* @uses wp386_header_style()
* @uses wp386_admin_header_style()
* @uses wp386_admin_header_image()
*
* @package _s
*/
function wp386_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'wp386_custom_header_args', array(
'default-image' => '',
'default-text-color' => '000',
'width' => 1000,
'height' => 250,
'flex-height' => true,
'wp-head-callback' => 'wp386_header_style',
'admin-head-callback' => 'wp386_admin_header_style',
'admin-preview-callback' => 'wp386_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'wp386_custom_header_setup' );
if ( ! function_exists( 'wp386_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @see wp386_custom_header_setup().
*/
function wp386_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 ( 'blank' == $header_text_color ) :
?>
.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 $header_text_color; ?>;
}
<?php endif; ?>
</style>
<?php
}
endif; // wp386_header_style
if ( ! function_exists( 'wp386_admin_header_style' ) ) :
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*
* @see wp386_custom_header_setup().
*/
function wp386_admin_header_style() {
?>
<style type="text/css">
.appearance_page_custom-header #headimg {
border: none;
}
#headimg h1,
#desc {
}
#headimg h1 {
}
#headimg h1 a {
}
#desc {
}
#headimg img {
}
</style>
<?php
}
endif; // wp386_admin_header_style
if ( ! function_exists( 'wp386_admin_header_image' ) ) :
/**
* Custom header image markup displayed on the Appearance > Header admin panel.
*
* @see wp386_custom_header_setup().
*/
function wp386_admin_header_image() {
$style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
$header_image = get_header_image();
?>
<div id="headimg">
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<div class="displaying-header-text" id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
<?php if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo esc_url( $header_image ); ?>" alt="">
<?php endif; ?>
</div>
<?php
}
endif; // wp386_admin_header_image

View File

@ -8,29 +8,7 @@
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'color': to,
'position': 'relative'
} );
}
$( '#masthead a.brand' ).text( to );
} );
} );
} )( jQuery );

View File

@ -1,22 +0,0 @@
/*
Theme Name: _s
Layout: Content-Sidebar-Sidebar
*/
.content-area {
float: left;
width: 100%;
}
.site-content {
margin: 0 40% 0 0;
}
.site-main .widget-area {
float: left;
margin: 0 0 0 -40%;
overflow: hidden;
width: 20%;
}
.site-footer {
clear: both;
width: 100%;
}

View File

@ -1,22 +0,0 @@
/*
Theme Name: _s
Layout: Content-Sidebar
*/
.content-area {
float: left;
margin: 0 -25% 0 0;
width: 100%;
}
.site-content {
margin: 0 25% 0 0;
}
.site-main .widget-area {
float: right;
overflow: hidden;
width: 25%;
}
.site-footer {
clear: both;
width: 100%;
}

View File

@ -1,22 +0,0 @@
/*
Theme Name: _s
Layout: Sidebar-Content-Sidebar
*/
.content-area {
float: left;
width: 100%;
}
.site-content {
margin: 0 20%;
}
.site-main .widget-area {
float: left;
margin: 0 0 0 -100%;
overflow: hidden;
width: 20%;
}
.site-footer {
clear: both;
width: 100%;
}

View File

@ -1,22 +0,0 @@
/*
Theme Name: _s
Layout: Sidebar-Content
*/
.content-area {
float: right;
margin: 0 0 0 -25%;
width: 100%;
}
.site-content {
margin: 0 0 0 25%;
}
.site-main .widget-area {
float: left;
overflow: hidden;
width: 25%;
}
.site-footer {
clear: both;
width: 100%;
}

View File

@ -1,22 +0,0 @@
/*
Theme Name: _s
Layout: Sidebar-Sidebar-Content
*/
.content-area {
float: right;
margin: 0 0 0 -40%;
width: 100%;
}
.site-content {
margin: 0 0 0 40%;
}
.site-main .widget-area {
float: left;
overflow: hidden;
width: 20%;
}
.site-footer {
clear: both;
width: 100%;
}

View File

@ -4,13 +4,12 @@ Theme URI: http://themes.kkob.us/wp386
Author: Keitaroh Kobayashi
Author URI: http://themes.kkob.us/
Description: A theme to make your blog look like some sort of thing from the future.
Version: 0.1-alpha
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags:
Tags: two-columns, left-sidebar, black, blue, sticky-post, custom-menu
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
WP386: A theme to make your blog look like some sort of thing from the future.
WP386 is based on Underscores http://underscores.me/, (C) 2012-2013 Automattic, Inc.
@ -108,7 +107,6 @@ Use it to make something cool, have fun, and share what you've learned with othe
margin: 0 0 1.5em;
}
/* =Asides
----------------------------------------------- */
@ -150,6 +148,7 @@ Use it to make something cool, have fun, and share what you've learned with othe
margin-bottom: 1.5em;
}
.gallery-caption {
display: initial;
}
.site-content .gallery a img {
border: none;
@ -202,6 +201,7 @@ object {
word-wrap: break-word;
}
.bypostauthor {
display: initial;
}
/* =Widgets
@ -289,10 +289,18 @@ object {
}
.sidebar-outer {
margin-top: 60px;
margin-top: 28px;
position: absolute;
top: 0;
bottom: 30px;
body.admin-bar & {
margin-top: 28px + 28px;
}
body.admin-bar.mp6 & {
margin-top: 28px + 32px;
}
}
.sidebar-container {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 172 KiB