Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Adds options to turn on/off and display meta tag for Apple Touch icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinyost committed Mar 18, 2012
1 parent cec281b commit 90eb47c
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
56 changes: 56 additions & 0 deletions functions.php
Expand Up @@ -46,6 +46,18 @@ function add_my_open_id_information(){
function add_favicons(){
?>
<link href="<?php echo get_bloginfo('url'); ?>/favicon.ico" rel="shortcut icon" />
<?php if(get_iphone_non_retina_icon()): ?>
<link rel="apple-touch-icon" sizes="57x57" href="<?php echo get_bloginfo('url'); ?>/apple-touch-icon-57x57-precomposed.png" />
<?php endif; ?>
<?php if(get_iphone_retina_icon()): ?>
<link rel="apple-touch-icon" sizes="72x72" href="<?php echo get_bloginfo('url'); ?>/apple-touch-icon-72x72-precomposed.png" />
<?php endif; ?>
<?php if(get_ipad_non_retina_icon()): ?>
<link rel="apple-touch-icon" sizes="114x114" href="<?php echo get_bloginfo('url'); ?>/apple-touch-icon-114x114-precomposed.png" />
<?php endif; ?>
<?php if(get_ipad_retina_icon()): ?>
<link rel="apple-touch-icon" sizes="144x144" href="<?php echo get_bloginfo('url'); ?>/apple-touch-icon-144x144-precomposed.png" />
<?php endif; ?>
<?php
}

Expand Down Expand Up @@ -158,6 +170,50 @@ function get_readability_verification_code(){
return $options['readability_verification_code'];
}

/**
* get_iphone_non_retina_icon function.
*
* @access public
* @return void
*/
function get_iphone_non_retina_icon() {
$options = get_theme_options();
return $options['apple_touch_icon_iphone_non_retina'];
}

/**
* get_iphone_retina_icon function.
*
* @access public
* @return void
*/
function get_iphone_retina_icon() {
$options = get_theme_options();
return $options['apple_touch_icon_iphone_retina'];
}

/**
* get_ipad_non_retina_icon function.
*
* @access public
* @return void
*/
function get_ipad_non_retina_icon() {
$options = get_theme_options();
return $options['apple_touch_icon_ipad_non_retina'];
}

/**
* get_ipad_retina_icon function.
*
* @access public
* @return void
*/
function get_ipad_retina_icon() {
$options = get_theme_options();
return $options['apple_touch_icon_ipad_retina'];
}

/**
* create_short_url function.
*
Expand Down
29 changes: 29 additions & 0 deletions library/theme-options.php
Expand Up @@ -74,6 +74,35 @@ function theme_options_do_page() {
</td>
</tr>
</table>

<h2>Meta Settings</h2>
<table class="form-table">
<tr valign="top"><th scope="row"><?php _e( 'Apple Touch Icon - 57x57' ); ?></th>
<td>
<input id="erdt_child_theme_options[apple_touch_icon_iphone_non_retina]" class="regular-checkbox" type="checkbox" name="erdt_child_theme_options[apple_touch_icon_iphone_non_retina]" value="1" <?php if($options['apple_touch_icon_iphone_non_retina'] == TRUE): ?> checked <?php endif; ?> />
<label class="description" for="erdt_child_theme_options[apple_touch_icon_iphone_non_retina]"><?php _e( 'Turn on the Apple Touch icon (Should be 57x57 pixels, in the webroot directory and named apple-touch-icon-57x57-precomposed.png). Sized for the iPhone Non-Retina Screen.' ); ?></label>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e( 'Apple Touch Icon 114x114' ); ?></th>
<td>
<input id="erdt_child_theme_options[apple_touch_icon_iphone_retina]" class="regular-checkbox" type="checkbox" name="erdt_child_theme_options[apple_touch_icon_iphone_retina]" value="1" <?php if($options['apple_touch_icon_iphone_retina'] == TRUE): ?> checked <?php endif; ?> />
<label class="description" for="erdt_child_theme_options[apple_touch_icon_iphone_retina]"><?php _e( 'Turn on the Apple Touch icon (Should be 114x114 pixels, in the webroot directory and named apple-touch-icon-114x114-precomposed.png). Sized for the iPhone Retina Screen.' ); ?></label>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e( 'Apple Touch Icon 72x72' ); ?></th>
<td>
<input id="erdt_child_theme_options[apple_touch_icon_ipad_non_retina]" class="regular-checkbox" type="checkbox" name="erdt_child_theme_options[apple_touch_icon_ipad_non_retina]" value="1" <?php if($options['apple_touch_icon_ipad_non_retina'] == TRUE): ?> checked <?php endif; ?> />
<label class="description" for="erdt_child_theme_options[apple_touch_icon_ipad_non_retina]"><?php _e( 'Turn on the Apple Touch icon (Should be 72x72 pixels, in the webroot directory and named apple-touch-icon-144x144-precomposed.png). Sized for the iPad Non-Retina Screen.' ); ?></label>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e( 'Apple Touch Icon 144x144' ); ?></th>
<td>
<input id="erdt_child_theme_options[apple_touch_icon_ipad_retina]" class="regular-checkbox" type="checkbox" name="erdt_child_theme_options[apple_touch_icon_ipad_retina]" value="1" <?php if($options['apple_touch_icon_ipad_retina'] == TRUE): ?> checked <?php endif; ?> />
<label class="description" for="erdt_child_theme_options[apple_touch_icon_ipad_retina]"><?php _e( 'Turn on the Apple Touch icon (Should be 144x144 pixels, in the webroot directory and named apple-touch-icon-144x144-precomposed.png). Sized for the iPad Retina Screen.' ); ?></label>
</td>
</tr>
</table>

<h2>Other Settings</h2>
<table class="form-table">
<tr valign="top"><th scope="row"><?php _e( 'Censored Website Bar' ); ?></th>
Expand Down

0 comments on commit 90eb47c

Please sign in to comment.