-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
104 lines (87 loc) · 3.02 KB
/
Copy pathfunctions.php
File metadata and controls
104 lines (87 loc) · 3.02 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
<?php
if (!function_exists('bdw_setup')) :
function bdw_setup() {
// adds theme support
add_theme_support('nav-menus');
// registers a "nav_menu" to be called into theme customization
// create an area in the "customize" section for a nav menu.
register_nav_menu('primary', __('Navigation Menu', 'bdw'));
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
// add support for common post types.
add_theme_support('post-formats', [
'aside',
'chat',
'gallery',
'image',
'link',
'quote',
'status',
'video',
'audio'
]);
// add theme support for thumbnails.
add_theme_support('post-thumbnails');
// custom images sizes
add_image_size('custom', 300, 200, true);
}
// end bdw setup
endif;
add_action('after_setup_theme', 'bdw_setup');
// adds area for wordpress widgets.
function bdw_widgets_init() {
register_sidebar([
'name' => __('Primary Widget Area', 'bdw'),
'id' => 'widget01',
'description' => __('The primary widget area'),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => '</li>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
]);
// creates second widget
register_sidebar([
'name' => __('Surprise Mother Fucker', 'bdw'),
'description' => __('Surprise Mother Fucker'),
'id' => 'widget02',
'before_widget' => '<li id="%1s" class="widget-container %2s">',
'after_widget' => '</li>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
]);
}
add_action('widgets_init', 'bdw_widgets_init');
// creating custom post types.
//defaults to single.php, need to add single-show.php to for custom template.
add_action('init', 'create_post_type');
function create_post_type() {
register_post_type('show', [
'labels' => [
'name' => __('Show'),
'singular_name' => __('Show'),
'add_new_item' => __('Add New Show Item'),
'edit_item' => __('Edit Show item'),
'new_item' => __('New Show Item'),
'all_items' => __('All Show Items'),
'view_items' => __('View Show'),
'search_items' => __('Search Show'),
'not_found' => __('No Show Found'),
'not_found_in_trash' => __('No Show items in trash'),
'parent_item_colon' => '',
'menu_name' => 'Show'
],
'public' => true,
'has_archive' => true,
'supports' => ['title', 'editor', 'thumbnail', 'custom-fields', 'comments', 'categories']
]);
}
//jQuery Insert From Google
// coppied from css tricks
if (!is_admin()) {
add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
}
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
wp_enqueue_script('jquery');
}