Advanced Customizations

4 min read Updated

These PHP snippets change Unwind in ways that Theme Settings do not cover, from the read more text to the footer credit and WooCommerce upsells. Add them to the functions.php file of a child theme or use the Code Snippets plugin. To add a snippet with Code Snippets:

  1. Install and activate the Code Snippets plugin.
  2. Go to SnippetsAdd New.
  3. Name the snippet and paste the code.
  4. Click Save and Activate.

Some customizations below also have a Code Snippets import file. To use one, unzip it, go to SnippetsImport, upload the JSON file, then activate the snippet.

You can use several snippets together. Each named function must have a unique name, or PHP stops with an error. For CSS changes, see CSS Snippets.

Fonts

Change from Google to Bunny Fonts

Unwind loads its web fonts from Google Fonts: the default Lato and Merriweather, or the fonts you choose in AppearanceCustomizeTheme SettingsFonts. This customization loads them from Bunny Fonts instead.

add_filter( 'siteorigin_web_font_url', function( $url ) {
	return 'https://fonts.bunny.net/css';
} );

Blog

Change the Continue Reading Text

Unwind shows a Continue reading link after the excerpt and after the more tag in a post. The excerpt link shows when Post excerpt Read More link is on in AppearanceCustomizeTheme SettingsBlog. This customization changes the link text in both places. Change Read more to the text you want.

add_filter( 'gettext_siteorigin-unwind', function( $translation, $text ) {
	if ( 'Continue reading' === $text ) {
		return 'Read more';
	}
	return $translation;
}, 10, 2 );

The button on each slide of the posts slider uses the text Continue Reading, with a capital R. To change the button too, add a second check for that text.

Change the Offset Layout Date Format

The Offset blog layout shows the date in the M d, Y format, for example Oct 02, 2026. Use a PHP date format to change it.

add_filter( 'siteorigin_unwind_date_format', function( $format ) {
	return 'F j, Y';
} );

Page Settings

Change the Page Settings Defaults

Use this function to change the defaults of the Page settings box and of Page Template Settings. See Page Settings. This example sets Page Layout to No Sidebar. The new default applies wherever the settings have not been saved yet, for example on new pages and posts.

function siteorigin_unwind_child_alter_page_setting_defaults( $defaults, $type, $id ) {
	$defaults['layout'] = 'no-sidebar';
	return $defaults;
}
add_filter( 'siteorigin_page_settings_defaults', 'siteorigin_unwind_child_alter_page_setting_defaults', 15, 3 );

The keys you can change are layout, page_title, masthead_margin, footer_margin, display_masthead and display_footer_widgets. The layout values are default, no-sidebar, full-width and full-width-sidebar. The other keys take true or false. To change the default for pages only, wrap the line in if ( 'page' === $type ) { ... }. To see all defaults, look at the siteorigin_unwind_setup_page_setting_defaults function in inc/settings.php on GitHub.

Code Snippets import file: Page Settings Defaults.

Enable Page Settings for a Custom Post Type

Unwind adds the Page settings box to pages, posts and Jetpack Portfolio projects. Replace my_custom_post_type with the slug of your custom post type.

add_action( 'init', function() {
	add_post_type_support( 'my_custom_post_type', 'so-page-settings' );
} );

The footer bottom bar shows a Theme by SiteOrigin credit. To change or remove the credit, use the siteorigin_unwind_footer_credits filter. Unwind passes the credit through wp_kses_post, so only basic HTML is kept. Return an empty string to remove the credit. The SiteOrigin Premium No Attribution Addon uses this filter too.

add_filter( 'siteorigin_unwind_footer_credits', function( $credit ) {
	return '<span>Built by Northfield Studio</span>';
} );

Layout

Adjust the Content Width Value

Change the content width that WordPress uses for embeds and images. The default is 1140.

add_filter( 'siteorigin_unwind_content_width', function( $content_width ) {
	return 900;
} );

Hide the Breadcrumbs

Unwind shows breadcrumbs when a supported breadcrumb plugin is active, as Integrated Plugins explains. This customization hides them on the whole site and keeps the plugin active.

add_filter( 'siteorigin_settings_show_breadcrumbs', '__return_false' );

Widgets

Use the Block Widget Editor

Unwind turns off the block widget editor of WordPress, so AppearanceWidgets shows the classic widgets screen. This customization turns the block widget editor back on.

add_filter( 'siteorigin_settings_disable_new_widget_area', '__return_false' );

WooCommerce

Change the Number of Upsell Products

Unwind shows up to four upsell products in one row below the product details. To show fewer, change 3 to the number you want. Keep it at four or below, because the theme styles upsells four to a row.

add_filter( 'woocommerce_upsell_display_args', function( $args ) {
	$args['posts_per_page'] = 3;
	return $args;
} );

Show Cross-Sells on the Cart Page

Unwind removes the cross-sell products from the cart page. This customization adds them back below the cart when the cart page uses the classic cart shortcode; the Cart block has its own cross-sells block.

function siteorigin_unwind_child_cart_cross_sells() {
	add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
}
add_action( 'init', 'siteorigin_unwind_child_cart_cross_sells' );