-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
52 lines (42 loc) · 1.42 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
function wordpressify_resources() {
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_script( 'header_js', get_template_directory_uri() . '/js/header-bundle.js', null, 1.0, false );
wp_enqueue_script( 'footer_js', get_template_directory_uri() . '/js/footer-bundle.js', null, 1.0, true );
}
add_action( 'wp_enqueue_scripts', 'wordpressify_resources' );
// Customize excerpt word count length
function custom_excerpt_length() {
return 22;
}
add_filter( 'excerpt_length', 'custom_excerpt_length' );
// Theme setup
function wordpressify_setup() {
// Handle Titles
add_theme_support( 'title-tag' );
// Add featured image support
add_theme_support( 'post-thumbnails' );
add_image_size( 'small-thumbnail', 720, 720, true );
add_image_size( 'square-thumbnail', 80, 80, true );
add_image_size( 'banner-image', 1024, 1024, true );
}
add_action( 'after_setup_theme', 'wordpressify_setup' );
show_admin_bar( false );
// Checks if there are any posts in the results
function is_search_has_results() {
return 0 != $GLOBALS['wp_query']->found_posts;
}
// Add Widget Areas
function wordpressify_widgets() {
register_sidebar(
array(
'name' => 'Sidebar',
'id' => 'sidebar1',
'before_widget' => '<div class="widget-item">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'wordpressify_widgets' );