Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
various files.
  • Loading branch information
krogsgard committed Nov 7, 2012
1 parent 9f0dc2f commit 8857e9b
Show file tree
Hide file tree
Showing 8 changed files with 252 additions and 136 deletions.
79 changes: 79 additions & 0 deletions happy-child/functions.php
@@ -0,0 +1,79 @@
<?php

/* Child theme setup function
*****************************
**************************
***********************
*********************
*/

add_action( 'after_setup_theme', 'happychild_theme_setup', 11 );

function happychild_theme_setup() {




/* Add the search form to the secondary menu. Uncommenting this action will put a searchform at the end of the
* secondary menu
*/

// add_action( "{$prefix}_close_menu_secondary", 'get_search_form' );

/* To unregister sidebars currently in the parent theme, do so with the following action. Also remember to
* uncomment the corresponding function further down this functionsfile
*/

// add_action( 'widgets_init', 'happy_unregister_sidebars', 11 );

/* For sites that may require a page have its own custom stylesheet, such as a landing page or form page where main site styles
* are not wanted, enable the following feature, and then you can create stylesheet for custom pages
*/

// add_theme_support( 'post-stylesheets' );

/*
// add image sizes for this site
add_image_size( 'tiny', 80, 80, true );
add_image_size( 'wide-thumb', 220, 120, true );
add_image_size( 'feature', 940, 370, true );
*/

}

/* End setup function. All functions go after this. Actions and filters should go above
************************************************************************************
***********************************************************************************
*********************************************************************************
*******************************************************************************
*****************************************************************************
***************************************************************************
*************************************************************************
***********************************************************************
*********************************************************************
* Start functions after this. All actions and filters should go above
*/


/**
* Adds custom image sizes for use
* typically with feature widget areas
* to add a custom image size, follow the method below
* make the names applicable to the application
*
*/


/**
* Unregisters some of the core framework sidebars that the theme doesn't use.
*
* @since 0.1.0
*/

function happy_unregister_sidebars() {
unregister_sidebar( 'header' );
unregister_sidebar( 'after-singular' );
}


Binary file added happy-child/screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions happy-child/style.css
@@ -0,0 +1,16 @@
/**
* Theme Name: Happy Sample Child
* Theme URI: http://happyloops.com
* Description: A child theme of the Happy parent theme.
* Version: 0.1
* Author: Brian Krogsgard
* Author URI: http://krogsgard.com
* Tags: theme-options, threaded-comments, microformats, translation-ready, rtl-language-support, one-column, two-columns, three-columns, fixed-width, custom-colors
* License: GNU General Public License v2.0
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Template: happy
*/


@import "../happy/style.css";

7 changes: 5 additions & 2 deletions happy/functions.php
Expand Up @@ -65,6 +65,10 @@ function happy_theme_setup() {


add_theme_support( 'post-formats', array( 'aside', 'gallery', 'image', 'link', 'quote', 'video' ) ); add_theme_support( 'post-formats', array( 'aside', 'gallery', 'image', 'link', 'quote', 'video' ) );


/* Register support for custom backgrounds */

add_theme_support( 'custom-background' );

/* Wraps <blockquote> around quote posts. */ /* Wraps <blockquote> around quote posts. */
add_filter( 'the_content', 'happy_quote_content' ); add_filter( 'the_content', 'happy_quote_content' );


Expand Down Expand Up @@ -186,12 +190,11 @@ function happy_scripts() {


$protocol = is_ssl() ? 'https' : 'http'; $protocol = is_ssl() ? 'https' : 'http';


wp_enqueue_style( 'happy-fonts', "$protocol://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic,700italic", array(), null ); wp_enqueue_style( 'happy-fonts', "$protocol://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic", array(), null );


} }





/** /**
* Registers new sidebars for the theme. * Registers new sidebars for the theme.
* *
Expand Down
73 changes: 2 additions & 71 deletions happy/includes/custom-header.php
Expand Up @@ -22,7 +22,7 @@
function happy_custom_header_setup() { function happy_custom_header_setup() {
$args = array( $args = array(
// Text color and image (empty to use none). // Text color and image (empty to use none).
'default-text-color' => '444', 'header-text' => false,
'default-image' => '', 'default-image' => '',


// Set height and width, with a maximum value for the width. // Set height and width, with a maximum value for the width.
Expand All @@ -39,54 +39,14 @@ function happy_custom_header_setup() {


// Callbacks for styling the header and the admin preview. // Callbacks for styling the header and the admin preview.
'wp-head-callback' => 'happy_header_style', 'wp-head-callback' => 'happy_header_style',
'admin-head-callback' => 'happy_admin_header_style', 'admin-head-callback' => '',
'admin-preview-callback' => 'happy_admin_header_image', 'admin-preview-callback' => 'happy_admin_header_image',
); );


add_theme_support( 'custom-header', $args ); add_theme_support( 'custom-header', $args );
} }
add_action( 'after_setup_theme', 'happy_custom_header_setup' ); add_action( 'after_setup_theme', 'happy_custom_header_setup' );


/**
* Styles the header text displayed on the blog.
*
* get_header_textcolor() options: 444 is default, hide text (returns 'blank'), or any hex value.
*
* @since Twenty Twelve 1.0
*/
function happy_header_style() {
$text_color = get_header_textcolor();

// If no custom options for text are set, let's bail
if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
return;

// If we get this far, we have custom styles.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( ! display_header_text() ) :
?>
.site-title,
.site-description {
position: absolute !important;
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-title a,
.site-description {
color: #<?php echo $text_color; ?> !important;
}
<?php endif; ?>
</style>
<?php
}

/** /**
* Styles the header image displayed on the Appearance > Header admin panel. * Styles the header image displayed on the Appearance > Header admin panel.
* *
Expand All @@ -98,27 +58,6 @@ function happy_admin_header_style() {
.appearance_page_custom-header #headimg { .appearance_page_custom-header #headimg {
border: none; border: none;
} }
#headimg h1,
#headimg h2 {
line-height: 1.6;
margin: 0;
padding: 0;
}
#headimg h1 {
font-size: 30px;
}
#headimg h1 a {
color: #515151;
text-decoration: none;
}
#headimg h1 a:hover {
color: #21759b;
}
#headimg h2 {
color: #777;
font: normal 13px/1.8 "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
margin-bottom: 24px;
}
#headimg img { #headimg img {
max-width: <?php echo get_theme_support( 'custom-header', 'max-width' ); ?>px; max-width: <?php echo get_theme_support( 'custom-header', 'max-width' ); ?>px;
} }
Expand All @@ -135,14 +74,6 @@ function happy_admin_header_style() {
function happy_admin_header_image() { function happy_admin_header_image() {
?> ?>
<div id="headimg"> <div id="headimg">
<?php
if ( ! display_header_text() )
$style = ' style="display:none;"';
else
$style = ' style="color:#' . get_header_textcolor() . ';"';
?>
<h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
<?php $header_image = get_header_image(); <?php $header_image = get_header_image();
if ( ! empty( $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="" /> <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="" />
Expand Down
6 changes: 2 additions & 4 deletions happy/searchform.php
Expand Up @@ -8,13 +8,11 @@
* @subpackage Template * @subpackage Template
*/ */
?> ?>
<div class="search"> <div class="s">


<form method="get" class="search-form" action="<?php echo trailingslashit( esc_url( home_url( '/' ) ) ); ?>"> <form method="get" class="searchform" action="<?php echo trailingslashit( esc_url( home_url( '/' ) ) ); ?>">
<div>
<input class="search-text" type="text" name="s" value="<?php if ( is_search() ) echo esc_attr( get_search_query() ); else esc_attr_e( 'Search this site...', 'happy' ); ?>" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" /> <input class="search-text" type="text" name="s" value="<?php if ( is_search() ) echo esc_attr( get_search_query() ); else esc_attr_e( 'Search this site...', 'happy' ); ?>" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" />
<input class="search-submit button" name="submit" type="submit" value="<?php esc_attr_e( 'Search', 'happy' ); ?>" /> <input class="search-submit button" name="submit" type="submit" value="<?php esc_attr_e( 'Search', 'happy' ); ?>" />
</div>
</form><!-- .search-form --> </form><!-- .search-form -->


</div><!-- .search --> </div><!-- .search -->
28 changes: 28 additions & 0 deletions happy/style.css
Expand Up @@ -21,4 +21,32 @@
position: relative; position: relative;
bottom: 0; bottom: 0;
left: 45%; left: 45%;
}

.pa-image {
float: left;
margin-bottom: 8px;
margin-bottom: .5rem;
}
.pa-copy {
float: left;
width: 92px;
width: 5.75rem;
font-size: 11px;
font-size: .6875rem;
margin-bottom: 8px;
margin-bottom: .5rem;
font-weight: normal;
color: #666;
text-decoration: none;
margin-left: 7px;
margin-left: .4375rem;
}

.pa-id {
font-size: 11px;
font-size: .6875rem;
color: #666;
text-decoration: none;
clear: both;
} }

0 comments on commit 8857e9b

Please sign in to comment.