Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Did you do this modification in a Child Theme? Otherwise your code may have been wiped.
No because the function is in the raindrops theme. I placed it in there. When I upgraded boots it obviously wiped my change. I’m too new to know how to do this so it doesn’t change the code in the future, outside of changing the version of the theme in the css.
Feel free to educate me. 🙂
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
If you set up a Child Theme, https://codex.wordpress.org/Child_Themes , you can retain your modifications after the theme updates.
E.g. try copying the function into your Child Theme functions.php file:
function raindrops_site_title( $text = "" ) {
global $raindrops_document_type;
if ( 'xhtml' == $raindrops_document_type ) {
if ( is_home() || is_front_page() ) {
$heading_elememt = 'h1';
} else {
$heading_elememt = 'div';
}
} else {
$heading_elememt = 'h1';
}
$header_text_color = get_theme_mod( 'header_textcolor' );
// check hex value if ( 'blank' == $header_text_color || '' == $header_text_color )
if ( preg_match('|^([A-Fa-f0-9]{3}){1,2}$|', $header_text_color ) ) {
$hd_style = ' style="color:#' . $header_text_color . ';"';
} else {
$hd_style = '';
}
$title_format = '<%1$s class="%6$s" id="site-title"><a href="%2$s" title="%3$s" rel="%4$s"><span>%5$s</span></a></%1$s>';
$html = sprintf( $title_format,
$heading_elememt,
esc_url( home_url() ),
esc_attr( 'site title ' . get_bloginfo( 'name', 'display' ) ),
"home",
get_bloginfo( 'name', 'display' ) . esc_html( $text ),
apply_filters( 'raindrops_site_title_class', 'h1' )
);
return apply_filters( "raindrops_site_title", $html );
}
Then make your modifications there.