esc_html__( 'Primary', 'suri' ),
'header' => esc_html__( 'Header', 'suri' ),
'footer' => esc_html__( 'Footer', 'suri' ),
'social' => esc_html__( 'Social', 'suri' ),
) );
/**
* Filter custom background args.
*
* @since 0.0.3
*/
$suri_custom_background_args = apply_filters(
'suri_custom_background_args', array(
'default-color' => 'f2f2f2',
'default-image' => '',
)
);
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', $suri_custom_background_args );
/**
* Filter custom logo args.
*
* @since 0.0.3
*/
$suri_custom_logo_args = apply_filters(
'suri_custom_logo_args', array(
'flex-width' => true,
'flex-height' => true,
'width' => 56,
'height' => 56,
)
);
// Set up the WordPress core custom logo feature.
add_theme_support( 'custom-logo', $suri_custom_logo_args );
/**
* Filter custom header args.
*
* @since 0.0.3
*/
$suri_custom_header_args = apply_filters(
'suri_custom_header_args', array(
'default-image' => '',
'width' => 1366,
'height' => 400,
'flex-width' => true,
'flex-height' => true,
'header-text' => true,
'default-text-color' => '',
'wp-head-callback' => 'suri_header_style',
'admin-head-callback' => '',
'admin-preview-callback' => '',
)
);
// Set up the WordPress core custom header feature.
add_theme_support( 'custom-header', $suri_custom_header_args );
/**
* Filter support for suri theme specific features.
*
* @since 0.0.3
*/
$suri_theme_support = apply_filters( 'suri_theme_support', array( 'schema', 'thumb', 'genericons' ) );
foreach ( $suri_theme_support as $support ) {
// Custom addon support for suri theme.
add_theme_support( "suri_{$support}" );
}
}
/**
* Register widget area.
*
* @since 0.0.3
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
public static function register_sidebar() {
/**
* Filter register widgets args.
*
* @since 0.0.3
*/
$widgets = apply_filters(
'suri_register_sidebar', array(
array( 'name' => esc_html__( 'Sidebar', 'suri' ), 'id' => 'sidebar-1', 'description' => '' ),
array( 'name' => esc_html__( 'Header', 'suri' ), 'id' => 'header', 'description' => '' ),
array( 'name' => esc_html__( 'footer-widget-1', 'suri' ), 'id' => 'footer-1', 'description' => '' ),
array( 'name' => esc_html__( 'footer-widget-2', 'suri' ), 'id' => 'footer-2', 'description' => '' ),
array( 'name' => esc_html__( 'footer-widget-3', 'suri' ), 'id' => 'footer-3', 'description' => '' ),
)
);
foreach ( $widgets as $widget ) {
register_sidebar( array(
'name' => $widget['name'],
'id' => $widget['id'],
'description' => $widget['description'],
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
}
}
/**
* Get Google fonts url to regesiter and enqueue.
*
* @since 0.1.3
*
* @return string Google fonts URL for the theme.
*/
public static function google_font_url() {
$font_url = '//fonts.googleapis.com/css?family=Merriweather:300,300i,400,700,700i';
/**
* Filter google font url.
*
* @since 0.1.3
*/
return apply_filters( 'suri_google_font_url', $font_url );
}
/**
* Enqueue scripts and styles.
*
* @since 0.0.3
*/
public static function enqueue_scripts() {
wp_enqueue_style( 'suri-style', get_stylesheet_uri() );
wp_enqueue_style( 'suri-fonts', self::google_font_url(), array(), null );
wp_enqueue_style( 'suri-ie8', get_template_directory_uri() . '/resources/css/ie8.css' );
wp_style_add_data( 'suri-ie8', 'conditional', 'lt IE 9' );
wp_enqueue_script( 'suri-scripts', get_template_directory_uri() . '/resources/js/scripts.js', array(), '1.0.0', true );
add_filter( 'script_loader_tag', function( $tag, $handle ) {
if ( 'suri-scripts' === $handle ) :
$tag = "$tag";
endif;
return $tag;
}, 10, 2 );
wp_enqueue_script( 'suri-ie8-scripts', get_template_directory_uri() . '/resources/js/ie8.js', array(), '1.0.0', true );
add_filter( 'script_loader_tag', function( $tag, $handle ) {
if ( 'suri-ie8-scripts' === $handle ) :
$tag = "";
endif;
return $tag;
}, 10, 2 );
wp_enqueue_script( 'html5shiv', get_template_directory_uri() . '/resources/js/html5.js', array(), '1.0.0', false );
add_filter( 'script_loader_tag', function( $tag, $handle ) {
if ( 'html5shiv' === $handle ) :
$tag = "";
endif;
return $tag;
}, 10, 2 );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) :
wp_enqueue_script( 'comment-reply' );
endif;
}
/**
* Load theme core and addon files
*
* @since 0.0.3
*/
public static function include_files() {
$suri_dir = trailingslashit( get_template_directory() );
$essential_files = array(
'helper/function-attr',
'helper/function-defaults',
'helper/function-header-style',
'helper/function-inline-css',
'helper/function-thumbnails',
'class-display',
'class-filters',
'customizer/class-active',
'customizer/class-data',
'customizer/class-sanitization',
'customizer/class-customizer',
'jetpack',
);
foreach ( $essential_files as $file ) {
/**
* Load theme core functions files.
*/
require_once( "{$suri_dir}inc/{$file}.php" );
}
$addon_files = array(
'thumb' => array( 'thumb', 'set-thumbnail', 'delete-thumbnail' ),
'schema' => array( 'schema' ),
'genericons' => array( 'genericons' ),
);
foreach ( $addon_files as $feature => $files ) {
foreach ( $files as $file ) {
/**
* Conditionally load theme addon files.
*/
require_if_theme_supports( "suri_{$feature}", "{$suri_dir}addon/{$feature}/{$file}.php" );
}
}
}
}
Suri_Init::setup();