-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
143 lines (85 loc) · 3.33 KB
/
functions.php
File metadata and controls
143 lines (85 loc) · 3.33 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
function portfolio_styles() {
// Add in stylesheets
wp_register_style('boilerplate', get_template_directory_uri() . '/css/boilerplate.css', array(), '2.0');
wp_register_style('googlefont_marcellus', 'https://fonts.googleapis.com/css?family=Marcellus', array(), '1.0.0');
wp_register_style('googlefont_raleway', 'https://fonts.googleapis.com/css?family=Raleway:200,300', array(), '1.0.0');
wp_register_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0');
wp_register_style('style', get_template_directory_uri() . '/style.css', array('boilerplate'), '1.0');
// Add in scripts
wp_register_script('jquery', 'https://code.jquery.com/jquery-3.2.1.js', array(), '3.2.1', true);
// cloudfare and scrollspy scripts enable the scrollspy navigation without Bootstrap
wp_register_script('cloudfare', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js', array('jquery'), '2.1.3', true);
wp_register_script('scrollspy', 'https://rawgit.com/r3plica/Scrollspy/master/scrollspy.js', array('jquery'), '1.0', true);
wp_register_script('script', get_template_directory_uri() . '/js/script.js', array('jquery'), '1.0', true);
// Enqueue the styles
wp_enqueue_style('boilerplate');
wp_enqueue_style('googlefont_marcellus');
wp_enqueue_style('googlefont_raleway');
wp_enqueue_style('fontawesome');
wp_enqueue_style('style');
// Enqueue the scripts
wp_enqueue_script('jquery');
wp_enqueue_script('cloudfare');
wp_enqueue_script('scrollspy');
wp_enqueue_script('script');
}
add_action('wp_enqueue_scripts', 'portfolio_styles');
// Register about post type
function portfolio_about() {
$args = array(
"labels" => array(
"name" => __( "About" )
),
"description" => __( "Description", "portfolio" ),
"public" => true,
"publicly_queryable" => true,
"rewrite" => array( "slug" => "about" ),
"show_ui" => true,
"menu_position" => 20
);
register_post_type( "about", $args);
}
add_action('init', 'portfolio_about');
// Register projects post type
function portfolio_projects() {
$args = array(
"labels" => array(
"name" => __( "Projects" ),
"singular_name" => __( "Project" )
),
"description" => __( "Description", "portfolio" ),
"public" => true,
"has_archive" => true,
"rewrite" => array( "slug" => "projects" ),
"menu_position" => 20
);
register_post_type( "projects", $args);
}
add_action('init', 'portfolio_projects');
// Register skills post type
function portfolio_skills() {
$args = array(
"labels" => array(
"name" => __( "Skills" ),
"singular_name" => __( "Skill" )
),
"description" => __( "Description", "portfolio" ),
"public" => true,
"publicly_queryable" => true,
"rewrite" => array( "slug" => "skills" ),
"show_ui" => true,
"menu_position" => 20
);
register_post_type( "skills", $args);
}
add_action('init', 'portfolio_skills');
// Add ing single-projects class to body on single-projects.php template
function single_projects_body_class( $classes ) {
if ( is_page_template( 'single-projects.php' ) ) {
$classes[] = 'single-projects';
}
return $classes;
}
add_filter( 'body_class', 'single_projects_body_class' );
?>