-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
131 lines (112 loc) · 5.27 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
<?php
// Custom template tags for this theme.
require get_stylesheet_directory() . '/inc/template-tags.php';
require get_stylesheet_directory() . '/inc/bootstrap_gallery.php';
if ( ! isset( $content_width ) ) {
$content_width = 850;
}
add_filter( 'comments_open', 'filter_media_comment_status', 10 , 2 );
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == 'attachment' ) {
return false;
}
return $open;
}
/**
* Enqueue scripts and styles for the front end.
*
* @since Twenty Fourteen 1.0
*/
function zbmfourteen_scripts() {
$version = '20150603';
//dequeue unused files
wp_dequeue_style('twentyfourteen-lato');
wp_dequeue_style('genericons');
wp_dequeue_style('twentyfourteen-style');
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_dequeue_script( 'comment-reply' );
}
if ( is_singular() && wp_attachment_is_image() ) {
wp_dequeue_script( 'twentyfourteen-keyboard-image-navigation');
}
if ( is_active_sidebar( 'sidebar-3' ) ) {
wp_dequeue_script( 'jquery-masonry' );
}
if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {
wp_dequeue_script( 'twentyfourteen-slider');
}
wp_dequeue_script('twentyfourteen-script');
// Load our main stylesheet.
wp_enqueue_style( 'zbmfourteen-font', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . '://fonts.googleapis.com/css?family=Boogaloo' );
wp_dequeue_script('twentyfourteen-style');
if (WP_DEBUG) {
wp_enqueue_style( 'zbmfourteen-style', get_stylesheet_uri(), array('zbmfourteen-font') );
} else {
wp_enqueue_style( 'zbmfourteen-style', get_stylesheet_directory_uri().'/style.php', array('zbmfourteen-font'), filemtime(dirname(__FILE__).'/style.min.css') );
}
if (WP_DEBUG) {
wp_enqueue_script( 'zbmfourteen-countdown', get_stylesheet_directory_uri() . '/js/jquery.countdown.min.js', array( 'jquery' ), $version, true );
wp_enqueue_script( 'zbmfourteen-carousel', get_stylesheet_directory_uri() . '/js/bootstrap/carousel.js', array( 'jquery' ), $version, true );
wp_enqueue_script( 'zbmfourteen-transition', get_stylesheet_directory_uri() . '/js/bootstrap/transition.js', array( 'jquery' ), $version, true );
wp_enqueue_script( 'zbmfourteen-functions', get_stylesheet_directory_uri() . '/js/functions.js', array( 'jquery', 'zbmfourteen-transition', 'zbmfourteen-carousel' ), $version, true );
/*
//tiled gallery
wp_enqueue_script( 'zbmfourteen-gallery-spin', get_stylesheet_directory_uri() . '/js/tiled-gallery/spin.js', array(), $version, true );
wp_enqueue_script( 'zbmfourteen-gallery-jqspin', get_stylesheet_directory_uri() . '/js/tiled-gallery/jquery.spin.js', array( 'jquery', 'zbmfourteen-gallery-spin' ), $version, true );
wp_enqueue_script( 'zbmfourteen-gallery-carousel', get_stylesheet_directory_uri() . '/js/tiled-gallery/jetpack-carousel.js', array( 'jquery', 'zbmfourteen-gallery-jqspin' ), $version, true );
wp_enqueue_script( 'zbmfourteen-gallery-tiled', get_stylesheet_directory_uri() . '/js/tiled-gallery/tiled-gallery.js', array( 'jquery' ), $version, true );
*/
} else {
wp_enqueue_script( 'zbmfourteen-all', get_stylesheet_directory_uri() . '/script.php', array( 'jquery' ), filemtime(dirname(__FILE__).'/script.min.js'), true );
}
remove_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
}
add_action( 'wp_enqueue_scripts', 'zbmfourteen_scripts', 1 );
/**
* Deregister WordPress default jQuery
* Register and Enqueue Google CDN jQuery
*/
function textdomain_jquery_enqueue() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://code.jquery.com/jquery-2.1.4.min.js", false, null );
// wp_register_script( 'jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js", false, null );
wp_enqueue_script( 'jquery' );
}
if ( !is_admin() ) {
add_action( 'wp_enqueue_scripts', 'textdomain_jquery_enqueue', 11 );
}
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
/**
* Remove tiled gallery styles
*/
if (WP_DEBUG) {
function tweakjp_rm_tiledcss(){
wp_dequeue_style( 'tiled-gallery' );
}
add_action( 'wp_footer', 'tweakjp_rm_tiledcss' );
function changejp_dequeue_styles() {
wp_dequeue_style( 'jetpack-carousel' );
}
add_action( 'post_gallery', 'changejp_dequeue_styles', 1001 );
}
/*
wp_register_script( 'spin', plugins_url( 'spin.js', __FILE__ ), false, '1.3' );
wp_register_script( 'jquery.spin', plugins_url( 'jquery.spin.js', __FILE__ ) , array( 'jquery', 'spin' ) );
wp_enqueue_script( 'jetpack-carousel', plugins_url( 'jetpack-carousel.js', __FILE__ ), array( 'jquery.spin' ), $this->asset_version( '20130109' ), true );
*/
function my_login_stylesheet() {
wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' );
}
add_action( 'login_enqueue_scripts', 'my_login_stylesheet' );
/**
* Register the impressum widget
*
*/
function zbmfourteen_widgets_init() {
require get_stylesheet_directory() . '/inc/widgets.php';
}
add_action( 'widgets_init', 'zbmfourteen_widgets_init' );