-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
110 lines (87 loc) · 3.13 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Register and Enqueue Styles.
*/
function coderdojo_register_styles() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_style( 'coderdojo-style', get_stylesheet_uri(), array(), $theme_version );
//wp_style_add_data( 'coderdojo-style', 'rtl', 'replace' );
// Add print CSS.
//wp_enqueue_style( 'coderdojo-print-style', get_template_directory_uri() . '/print.css', null, $theme_version, 'print' );
}
add_action( 'wp_enqueue_scripts', 'coderdojo_register_styles' );
/**
* Register and Enqueue Scripts.
*/
function coderdojo_register_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_script( 'coderdojo-js', get_template_directory_uri() . '/assets/js/index.js', array(), $theme_version, false );
wp_script_add_data( 'coderdojo-js', 'async', true );
}
add_action( 'wp_enqueue_scripts', 'coderdojo_register_scripts' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
add_theme_support( 'title-tag' );
/**
* POST SUPPORT
* Set up for page excerpts
*/
function coderdojo_post_support() {
// Add default posts and comments RSS feed links to head.
add_post_type_support( 'page', 'excerpt' );
}
add_action( 'after_setup_theme', 'coderdojo_post_support' );
/**
* Register navigation menus uses wp_nav_menu in five places.
*/
function coderdojo_menus() {
register_nav_menus(
array(
'desktop-navigation-menu' => __( 'Desktop Navigation Menu' ),
'mobile-navigation-menu' => __( 'Mobile Navigation Menu' ),
'footer-navigation-links' => __( 'Footer Navigation Links' ),
'footer-social-links' => __( 'Footer Social Links' )
)
);
}
add_action( 'init', 'coderdojo_menus' );
/**
* Register widget area.
*
* @since 1.0.0
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*
* @return void
*/
function coderdojo_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Blog Archive Sidebar', 'coderdojo' ),
'id' => 'archive-sidebar',
'description' => esc_html__( 'Add the search and categories widgets here to appear in your blog archive.', 'coderdojo' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer Address', 'coderdojo' ),
'id' => 'footer-sidebar',
'description' => esc_html__( 'Add the text widgit here to show your address in the footer', 'coderdojo' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'coderdojo_widgets_init' );