Advanced Customizations

Below you’ll find advanced customizations that aren’t included in theme settings. These customizations can either be added to a child theme functions.php file or by using the plugin Code Snippets. If you’d like to add a function using Code Snippets:

  1. Install and active the plugin, Code Snippets.
  2. Go to SnippetsAdd New.
  3. Name the snippet as you’d like to. Copy and paste the snippet into the provided field. Save and Activate.

Disable Google Fonts

The following filter allows you to choose the Google Fonts you’d like to use in the Ultra Customizer settings but self-host the font families. Ultra will output the necessary styles but won’t import the font from Google.

function ultra_child_setup() {
	if ( function_exists( 'siteorigin_webfonts_remove_font' ) ) {
		siteorigin_webfonts_remove_font( 'Muli' );
		siteorigin_webfonts_remove_font( 'Lato' );
	}
	add_filter( 'ultra_import_google_fonts', '__return_false' );
}
add_action( 'after_setup_theme', 'ultra_child_setup', 30 );

Remove the Category Page Title Prefix

function ultra_child_archive_title( $title ) {
	if ( is_category() ) {
		$title = single_cat_title( '', false );
	} elseif ( is_tag() ) {
		$title = single_tag_title( '', false );
	} elseif ( is_author() ) {
		$title = '<span class="vcard">' . get_the_author() . '</span>' ;
	}
	return $title;
}
add_filter( 'get_the_archive_title', 'ultra_child_archive_title' );
Last updated: 08/05/2024