ght' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
)
);
}
add_action( 'after_setup_theme', 'summer_blog_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function summer_blog_content_width() {
$GLOBALS['content_width'] = apply_filters( 'summer_blog_content_width', 640 );
}
add_action( 'after_setup_theme', 'summer_blog_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function summer_blog_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'summer-blog' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'summer-blog' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer 1', 'summer-blog' ),
'id' => 'footer-1',
'description' => __( 'Add widgets here to appear in your footer.', 'summer-blog' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer 2', 'summer-blog' ),
'id' => 'footer-2',
'description' => __( 'Add widgets here to appear in your footer.', 'summer-blog' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer 3', 'summer-blog' ),
'id' => 'footer-3',
'description' => __( 'Add widgets here to appear in your footer.', 'summer-blog' ),
'before_widget' => '',
'before_title' => '',
)
);
}
add_action( 'widgets_init', 'summer_blog_widgets_init' );
/**
* Enqueue theme fonts.
*/
function summer_blog_fonts() {
$fonts_url = summer_blog_get_fonts_url();
// Load Fonts if necessary.
if ( $fonts_url ) {
require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' );
wp_enqueue_style( 'summer-blog-fonts', wptt_get_webfont_url( $fonts_url ), array(), null );
}
}
add_action( 'wp_enqueue_scripts', 'summer_blog_fonts', 1 );
add_action( 'enqueue_block_editor_assets', 'summer_blog_fonts', 1 );
/**
* Retrieve webfont URL to load fonts locally.
*/
function summer_blog_get_fonts_url() {
$font_families = array(
'Poppins:400,500,600,700,800',
);
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
'display' => urlencode( 'swap' ),
);
return apply_filters( 'summer_blog_get_fonts_url', add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ) );
}
/**
* Enqueue scripts and styles.
*/
function summer_blog_scripts() {
wp_enqueue_style( 'summer-blog-style', get_stylesheet_uri() );
wp_style_add_data( 'summer-blog-style', 'rtl', 'replace' );
wp_enqueue_script( 'summer-blog-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
wp_enqueue_script( 'summer-blog-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );
wp_enqueue_script( 'summer-blog-custom-script', get_template_directory_uri() . '/js/custom-script.js', array('jquery'), '20151215', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'summer_blog_scripts' );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Functions which enhance the theme by hooking into WordPress.
*/
require get_template_directory() . '/inc/template-functions.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
?>