-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
executable file
·85 lines (61 loc) · 2.94 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
<?php
function theme_styles() {
wp_enqueue_style('bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css');
wp_enqueue_style('isotope_css', get_template_directory_uri() . '/css/isotope.css');
wp_enqueue_style('main_css', get_template_directory_uri() . '/style.css');
}
add_action('wp_enqueue_scripts','theme_styles');
function theme_js() {
global $wp_scripts;
wp_register_script('html5_shiv','https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js','','',false);
wp_register_script('respond_js','https://oss.maxcdn.com/respond/1.4.2/respond.min.js','','',false);
$wp_scripts->add_data('html5_shiv','conditional','lt IE 9');
$wp_scripts->add_data('respond_js','conditional','lt IE 9');
wp_enqueue_script('bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'),'',true);
wp_enqueue_script('theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery', 'bootstrap_js'),'',true);
}
add_action('wp_enqueue_scripts','theme_js');
// Diable admin bar for now
show_admin_bar(false);
add_theme_support('menus');
add_theme_support('post-thumbnails');
function register_theme_menus() {
register_nav_menus(
array(
'header-menu' => 'Header Menu'
)
);
}
add_action('init', 'register_theme_menus');
function load_fonts() {
wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700');
wp_register_style('fontAwesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css"');
wp_enqueue_style( 'googleFonts');
wp_enqueue_style( 'fontAwesome');
}
add_action('wp_print_styles', 'load_fonts');
function create_widget($name,$id,$description) {
register_sidebar(array(
'name'=>__($name),
'id'=>$id,
'description'=>__($description),
'before_widget'=>'<div class="widget">',
'after_widget'=>'</div>',
'before_title'=>'<h3>',
'after_title'=>'</h3>'
));
}
create_widget('Front Page Left','front-left','Displays on the left of the homepage');
create_widget('Front Page Center','front-center','Displays in the center of the homepage');
create_widget('Front Page Right','front-right','Displays on the right of the homepage');
create_widget('Page Sidebar','page','Displays on the side of pages with a sidebar');
create_widget('Blog Sidebar','blog','Displays on the side of pages in the blog section');
function add_isotope() {
wp_register_script( 'isotope', get_template_directory_uri().'/js/min/isotope-min.js', array('jquery'), true );
wp_register_script( 'isotope-init', get_template_directory_uri().'/js/filtering.js', array('jquery', 'isotope'), true );
wp_register_script( 'isotope-loaded', get_template_directory_uri().'/js/imagesloaded.pkgd.min.js', array('jquery'), true );
wp_enqueue_script('isotope-init');
wp_enqueue_script('isotope-loaded');
}
add_action( 'wp_enqueue_scripts', 'add_isotope' );
?>