-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
80 lines (64 loc) · 2.43 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
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'tentytwenty-style' for the Twenty Twenty theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_google_fonts' );
function my_theme_enqueue_google_fonts(){
wp_register_style( 'montserrat', 'https://fonts.googleapis.com/css?family=Montserrat:700&display=swap' );
wp_enqueue_style( 'montserrat' );
wp_register_style( 'lato', 'https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i&display=swap' );
wp_enqueue_style( 'lato' );
wp_register_style( 'roboto', 'https://fonts.googleapis.com/css?family=Roboto+Slab&display=swap' );
wp_enqueue_style( 'roboto slab' );
wp_enqueue_script( 'script', get_stylesheet_directory_uri() . '/js/resize_header.js', array ( 'jquery' ), 1.0, true);
}
// Add custom post type for homepage content
function create_posttype() {
register_post_type( 'homepage_content',
array(
'labels' => array(
'name' => __( 'Homepage Content' ),
'singular_name' => __( 'Entry' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'entries'),
'publicly_queryable' => false,
'menu_position' => 20,
'supports' => array(
'title',
'editor',
'custom-fields',
'revisions'
),
)
);
register_post_type( 'banner_content',
array(
'labels' => array(
'name' => __( 'Banner Content' ),
'singular_name' => __( 'Entry' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'entries'),
'publicly_queryable' => false,
'menu_position' => 20,
'supports' => array(
'title',
'editor',
'custom-fields',
'revisions'
),
)
);
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );