Skip to content

Commit

Permalink
Add option to disable the tagline from showing in the header.
Browse files Browse the repository at this point in the history
  • Loading branch information
tlongren committed Jun 3, 2011
1 parent 5139ef8 commit 87a8a2d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion header.php
Expand Up @@ -33,7 +33,7 @@

<hgroup>
<h1 id="site-title"><a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a></h1>
<h2 id="site-description"><?php bloginfo('description'); ?></h2>
<?php if ($html5press_settings['show_tagline'] == 1) { ?><h2 id="site-description"><?php bloginfo('description'); ?></h2><?php } ?>
</hgroup>

</header> <!-- end header -->
Expand Down
13 changes: 13 additions & 0 deletions theme-options.php
Expand Up @@ -3,6 +3,7 @@
// Default options values
$html5press_options = array(
'back_to_top' => true,
'show_tagline' => true,
'featured_image_size' => 'large',
'theme_color' => 'pink',
'featured_cat' => '',
Expand Down Expand Up @@ -128,6 +129,12 @@ function html5press_theme_options_page() {
<label for="back_to_top">Enabled</label>
</td>
</tr>
<tr valign="top"><th scope="row"><label for="show_tagline">Show Tagline In Header</label></th>
<td>
<input type="checkbox" id="show_tagline" name="html5press_options[show_tagline]" value="1" <?php checked( true, $settings['show_tagline'] ); ?> />
<label for="show_tagline">Enabled</label>
</td>
</tr>
<tr valign="top"><th scope="row"><label for="featured_image_size">Linked Featured Image Size</label></th>
<td>
<select id="featured_image_size" name="html5press_options[featured_image_size]">
Expand Down Expand Up @@ -226,6 +233,12 @@ function html5press_validate_options( $input ) {
if ( !array_key_exists( $input['featured_image_size'], $html5press_image_sizes ) )
$input['featured_image_size'] = $prev;

// If the checkbox has not been checked, we void it
if ( ! isset( $input['show_tagline'] ) )
$input['show_tagline'] = null;
// We verify if the input is a boolean value
$input['show_tagline'] = ( $input['show_tagline'] == 1 ? 1 : 0 );

// If the checkbox has not been checked, we void it
if ( ! isset( $input['back_to_top'] ) )
$input['back_to_top'] = null;
Expand Down

0 comments on commit 87a8a2d

Please sign in to comment.