-
Notifications
You must be signed in to change notification settings - Fork 10
Code Snippets
Jose Castaneda edited this page Jul 28, 2016
·
1 revision
The following code snippets can be used inside of your functions.php
file of the theme, child theme or in a functionality plugin.
add_action( 'after_setup_theme', function(){
add_theme_support( 'custom-header' );
add_filter( 'alpha_attr_site-header', function( $attr, $context ) {
if ( get_custom_header() ) {
$attr['style'] = "background: url( " . get_custom_header()->url . " ) fixed center;";
$attr['style'] .= 'background-size: cover;';
} else {
$attr['style'] = 'background: #feefee;';
}
$attr['style'] .= 'min-height: 18.75em;';
return $attr;
}, 10, 2 );
}, 10);
// First we remove the hook for that
remove_action( 'tha_footer_bottom', 'alpha_footer_content', 10 );
// then we add our own
add_action( 'tha_footer_bottom', function(){
printf( '<p class="credit">%s</p>', sprintf(
// Translators: 1 is current year, 2 is site name/link, 3 is WordPress name/link.
__( 'Copyright © %1$s %2$s.', 'text-domain' ),
date_i18n( 'Y' ),
carelib_get_site_link()
) );
});
remove_action( 'tha_header_bottom', 'alpha_menu_primary', 10 );
add_action( 'tha_header_after', 'alpha_menu_primary', 0 );