Advanced Customizations

Below you’ll find advanced customizations that aren’t included in theme settings. PHP customizations can be added to a child theme functions.php file. Certain customizations can be added using the Code Snippets plugin. If it’s possible to add a customization using Code Snippets, an import file will be provided.

In the event a customization can be added 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.

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_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 );

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.

Change the Continue Reading Button Text

The below function can be used to change the Continue reading text if Post Content is set to Full Post.

if ( ! function_exists( 'siteorigin_unwind_read_more_link' ) ) :
/**
 * Filter the read more link.
 */
function siteorigin_unwind_read_more_link() {
	$read_more_text = esc_html__( 'Continue reading', 'siteorigin-unwind' );
		return '<div class="more-link-wrapper"><a class="more-link" href="' . get_permalink() . '"><span class="more-text">' . $read_more_text . '</span></a></div>';
}
endif;
add_filter( 'the_content_more_link', 'siteorigin_unwind_read_more_link' );

The Grid, Alternate and Masonry layouts automatically use the excerpt. If you’ve set Post Content to Post Excerpt and have enabled Post Excerpt Read More Link or if you’re using the Grid, Alternate or Masonry layouts and have enabled the Post Excerpt Read More Link setting, the following function can be used to change the Continue reading text.

if ( ! function_exists( 'siteorigin_unwind_excerpt' ) ) :
/**
 * Outputs the excerpt.
 */
function siteorigin_unwind_excerpt() {

	if ( ( siteorigin_setting( 'blog_archive_content' ) == 'excerpt' || siteorigin_setting( 'blog_archive_layout' ) == 'grid' || siteorigin_setting( 'blog_archive_layout' ) == 'alternate' ) && siteorigin_setting( 'blog_excerpt_more', true ) && ! is_search() ) {
		$read_more_text = esc_html__( 'Continue reading', 'siteorigin-unwind' );
		$read_more_text = '<div class="more-link-wrapper"><a class="more-link" href="' . esc_url( get_permalink() ) . '"><span class="more-text">' . $read_more_text . '</span></a></div>';
	} else {
		$read_more_text = '';
	}
	$ellipsis = '...';
	$length = siteorigin_setting( 'blog_excerpt_length' );
	$excerpt = explode( ' ', get_the_excerpt(), $length );

	if ( $length ) {

		if ( count( $excerpt ) >= $length ) {
			array_pop( $excerpt );
			$excerpt = '<p>' . implode( " ", $excerpt ) . $ellipsis . '</p>' . $read_more_text;
		} else {
			$excerpt = '<p>' . implode( " ", $excerpt ) . $ellipsis . '</p>';
		}

	} else {
		
		$excerpt = get_the_excerpt();

	}

	$excerpt = preg_replace( '`\[[^\]]*\]`','', $excerpt );

	echo $excerpt;

}
endif;