Add favicon theme option.

This commit is contained in:
MickeyKay
2015-01-21 10:24:01 -08:00
parent 929de10320
commit 38b1f84f63
2 changed files with 26 additions and 4 deletions
+18 -3
View File
@@ -10,7 +10,7 @@
*/
/*===========================================
* Head Styles & Scripts
* Header
===========================================*/
add_action( 'wp_enqueue_scripts', 'trestle_header_actions' );
@@ -50,6 +50,20 @@ function trestle_header_actions() {
}
add_filter( 'genesis_pre_load_favicon', 'trestle_do_custom_favicon' );
/**
* Output custom favicon if specified in the theme options.
*
* @since 1.0.0
*
* @param string $favicon_url Default favicon URL.
*
* @return string Custom favicon URL (if specified), or the default URL.
*/
function trestle_do_custom_favicon( $favicon_url ) {
return genesis_get_option( 'trestle_favicon_url' ) ? genesis_get_option( 'trestle_favicon_url' ) : $favicon_url;
}
/*===========================================
* Body Classes
===========================================*/
@@ -420,8 +434,9 @@ function trestle_read_more_link( $default_text ) {
// Get Trestle custom "read more" link text
$custom_text = esc_attr( genesis_get_option( 'trestle_read_more_text' ) );
if ( $custom_text )
if ( $custom_text ) {
return '&hellip;&nbsp;<a class="more-link" title="' . $custom_text . '" href="' . get_permalink() . '">' . $custom_text . '</a>';
else
} else {
return $default_text;
}
}