-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
146 lines (101 loc) · 4.32 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
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
144
145
146
<?php
/**
* Bloodhound Theme
*
* @author Vallgroup LLC <[email protected]>
* @link https://github.com/vallgroup/Bloodhound GitHub
*
* This powers our whole theme loading classes when needed and registering all our hooks
* and scripts required. If you would like to customize some of this theme functionality
* create a child theme than editing this file. Because by creating a chil theme you avoid
* losing your changes when the theme gets updated in the future. For more information on
* parent child themes visit the Wordpress Codex.
*
* @link http://codex.wordpress.org/Child_Themes Read more about child themes
*
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 or later
*
* @package Bloodhound
* @subpackage Functions
*
* @since 1.0
*/
define( 'BH_DIR', get_stylesheet_directory_uri() );
require_once( 'includes/includes.php' );
add_action('switch_theme', array( Bloodhound_Theme_Options_Class::get_instance(), 'run_defaults' ) );
add_action( 'admin_menu', array( Bloodhound_Theme_Options_Class::get_instance(), 'theme_page_init' ) );
add_theme_support('post-thumbnails', array( 'page', 'post', 'team_member', 'project' ) );
register_nav_menu( 'primary', 'Bloodhound Menu' );
/**
* Register portfolio custom post type
*
* Holds instance of new CPT
*
* @see Premise WP Framework for more information
* @link https://github.com/vallgroup/Premise Premise WP Framework
*
* @var object
*/
$portfolio = new PremiseCPT( 'project', array( 'supports' => array( 'title', 'thumbnail', 'excerpt', 'editor' ) ) );
$portfolio->register_taxonomy(array(
'taxonomy_name' => 'project_category',
'singular' => 'Project Category',
'plural' => 'Project Categories',
'slug' => 'project-category',
));
/**
* Register team member custom post type
*
* Holds instance of new CPT
*
* @see Premise WP Framework for more information
* @link https://github.com/vallgroup/Premise Premise WP Framework
*
* @var object
*/
$team_member = new PremiseCPT( 'team_member', array( 'supports' => array( 'title', 'thumbnail', 'excerpt', 'editor' ) ) );
/**
* Load Team Member metaboxes
*
* @see bloodhound-classes/team-members-cpt-class.php
*/
if( is_admin() ){
add_action( 'load-post.php', 'call_Bloodhoundteam_memberClass' );
add_action( 'load-post-new.php', 'call_Bloodhoundteam_memberClass' );
}
if( !function_exists('bloodhound_enqueue_scripts') ) {
/**
* Site scripts
*/
function bloodhound_enqueue_scripts() {
wp_register_style( 'jquery_ui' , '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css' );
wp_register_style( 'googlefonts' , 'http://fonts.googleapis.com/css?family=Oswald:400,300,700|Nunito:400,300,700', array( 'jquery_ui' ) );
wp_register_style( 'bxslider_css' , BH_DIR . '/css/jquery.bxslider.css' );
wp_register_style( 'bloodhound_style' , BH_DIR . '/style.css', array( 'bxslider_css' ) );
wp_register_style( 'bloodhound_responsive' , BH_DIR . '/css/responsive.css', array( 'bloodhound_style' ) );
wp_register_script('bxslider_js' , BH_DIR . '/js/jquery.bxslider.min.js' );
wp_register_script('bloodhound_main_js' , BH_DIR . '/js/main.js', array( 'jquery', 'jquery-ui-accordion', 'bxslider_js' ) );
//wp_localize_script( 'bloodhound_admin_js', Bloodhound_Theme_Options_Class::$Ajax, array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
if( !is_admin() ) {
wp_enqueue_style( 'bloodhound_responsive' );
wp_enqueue_script( 'bloodhound_main_js' );
}
}
}
add_action('wp_enqueue_scripts', 'bloodhound_enqueue_scripts');
if( !function_exists('bloodhound_enqueue_admin_scripts') ) {
/**
* Admin scripts
*/
function bloodhound_enqueue_admin_scripts() {
wp_register_style('minicolors_css' , BH_DIR . '/includes/admin/css/jquery.minicolors.css');
wp_register_style('bloodhound_admin_css' , BH_DIR . '/includes/admin/css/bloodhound-admin.css', array('minicolors_css'));
wp_register_script('minicolors_js' , BH_DIR . '/includes/admin/js/jquery.minicolors.min.js');
wp_register_script('bloodhound_admin_js' , BH_DIR . '/includes/admin/js/bloodhound-admin.js', array('jquery', 'minicolors_js' ) );
if( is_admin() ) {
wp_enqueue_style( 'bloodhound_admin_css' );
wp_enqueue_script( 'bloodhound_admin_js' );
}
}
}
add_action( 'admin_enqueue_scripts', 'bloodhound_enqueue_admin_scripts' );