Advanced Customizations

Below you’ll find advanced customizations that aren’t included in theme settings. PHP 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 SnippetsImport.
  3. Import the function provided in the form of a JSON file. A JSON file is provided with each function below. Right click and Save As to download.

Disable Sticky Header On Mobile

The following customization will disable the sticky header below the point that the Mobile Menu Collapse field is set to.

if ( ! function_exists( 'siteorigin_north_child_body_classes' ) ) :
function siteorigin_north_child_body_classes( $classes ) {
	$classes[] = 'mobile-header-ns';
	return $classes;
}
endif;
add_filter( 'body_class', 'siteorigin_north_child_body_classes' );

Code Snippets Import File
Disable Sticky Header on Mobile Snippet. The JSON file is zipped; unzip it before importing it into Code Snippets.

Adjust Sticky Header Logo Scaling

The sticky header and logo scaling settings can be found at AppearanceCustomizeNavigation. If you’ve enabled these settings and would like to adjust the logo scaling, the following function can be used. The below function won’t work in Code Snippets and needs to be used in a child theme functions.php file.

if ( ! function_exists( 'siteorigin_north_child_logo_scaling' ) ) :
function siteorigin_north_child_logo_scaling( $scale ) {
	return 0.424;
}
add_filter( 'siteorigin_north_logo_sticky_scale', 'siteorigin_north_child_logo_scaling' );
endif;

Remove WooCommerce Single Product SKU and Categories

The following function will remove the SKU and product categories displayed under the title on the WooCOmmerce single product page.

function siteorigin_north_child_remove_wc_single_meta() {
  remove_action( 'woocommerce_single_product_summary', 'siteorigin_north_woocommerce_template_single_undertitle_meta', 7 );
}
add_action( 'after_setup_theme', 'siteorigin_north_child_remove_wc_single_meta' );

Code Snippets Import File
Remove WooCommerce Single Product SKU and Categories Snippet. Unzip the JSON file before importing into Code Snippets.

Change Page Settings Defaults

Using the below function you can adjust the page settings defaults. For example, if you’d like to set new posts and pages to default to Layout: No Sidebar, you could use the following function:

function siteorigin_north_child_alter_page_setting_defaults( $defaults, $type, $id ) {
	$defaults['layout'] = 'no-sidebar';

	return $defaults;
}
add_filter( 'siteorigin_page_settings_defaults', 'siteorigin_north_child_alter_page_setting_defaults', 15, 3 );

To view the available settings and values, please see the page-settings.php file on GitHub.

Code Snippets Import File
Page Settings Defaults. Unzip the JSON file before importing into Code Snippets.