-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
117 lines (98 loc) · 2.85 KB
/
Copy pathfunctions.php
File metadata and controls
117 lines (98 loc) · 2.85 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
<?php
// Load Stylesheets
function load_css()
{
wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), false, 'all');
wp_enqueue_style('bootstrap');
wp_register_style('main', get_template_directory_uri() . '/css/main.css', array(), false, 'all');
wp_enqueue_style('main');
}
add_action('wp_enqueue_scripts', 'load_css');
//Load JavaScript
function load_js()
{
wp_enqueue_script('jquery');
wp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', 'jquery', false, true);
wp_enqueue_script('bootstrap');
}
add_action('wp_enqueue_scripts', 'load_js');
//Theme Options
add_theme_support('menus');
add_theme_support('post-thumbnails');
add_theme_support('widgets');
//Menus
register_nav_menus(
array(
'top-menu' => 'Top Menu Location',
'mobile-menu' => 'Mobile Menu Location',
'footer-menu' => 'Footer Menu Location',
)
);
// Custom Image Sizes
add_image_size('blog-large', 900, 400, true);
add_image_size('blog-small', 300, 200, true);
// Register Sidebars
function my_sidebars()
{
register_sidebar(
array(
'name' => 'Page Sidebar',
'id' => 'page-sidebar',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>'
)
);
register_sidebar(
array(
'name' => 'Blog Sidebar',
'id' => 'blog-sidebar',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>'
)
);
}
// hook that runs when WP loads and checks which widgets and sidebars are available
add_action('widgets_init', 'my_sidebars');
function my_first_post_type()
{
$args = array(
'labels' => array(
'name' => 'Plants',
'singular_name' => 'Plant'
),
'hierarchical' => false,
'public' => true,
'has_archive' => true,
'menu_icon' => 'dashicons-format-image',
'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'),
// 'rewrite' => array('slug' => 'my-plants'),
);
register_post_type('plants', $args);
}
add_action('init', 'my_first_post_type');
function my_first_taxonomy()
{
$args = array(
'labels' => array(
'name' => 'Plants in My Yard',
'singular_name' => 'Plant in My Yard'
),
'public' => true,
'hierarchical' => false,
);
register_taxonomy('Plants in My Yard', array('plants'), $args);
}
add_action('init', 'my_first_taxonomy');
function my_second_taxonomy()
{
$args = array(
'labels' => array(
'name' => 'Plants I Want',
'singular_name' => 'Plant I Want'
),
'public' => true,
'hierarchical' => false,
);
register_taxonomy('Plants I Want', array('plants'), $args);
}
add_action('init', 'my_second_taxonomy');