-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
executable file
·147 lines (128 loc) · 4.96 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
147
<?php
// Info o motywie //
$theme = wp_get_theme();
$logo = get_template_directory_uri() . '/build/img/logo.png';
$version = $theme->get('Version');
$theme_name = $theme->get('Name');
$codename = 'Jessica Alba';
$codeimg = 'http://cs633618.vk.me/v633618187/1a842/cNH0Mgb-jHU.jpg';
// Dodatkowe style i skrypty dla panelu. Odpowiedzialne za otwieranie okna
// z mediami
// http://stackoverflow.com/a/26103160/1589989
if (is_admin()) {
function enqueue_admin()
{
$mode = get_user_option('media_library_mode', get_current_user_id()) ? get_user_option('media_library_mode', get_current_user_id()) : 'grid';
$modes = array('grid', 'list');
if (isset($_GET['mode']) && in_array($_GET['mode'], $modes)) {
$mode = $_GET['mode'];
update_user_option(get_current_user_id(), 'media_library_mode', $mode);
}
if (!empty($_SERVER['PHP_SELF']) && 'upload.php' === basename($_SERVER['PHP_SELF']) && 'grid' !== $mode) {
wp_dequeue_script('media');
}
wp_enqueue_media();
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
}
add_action('admin_enqueue_scripts', 'enqueue_admin');
}
remove_filter('template_redirect','redirect_canonical');
// Rejestrujemu menu //
register_nav_menus(
array(
'main_menu' => 'Topbar',
)
);
// Dodatkowe funkcje porozrzucane po plikach //
// Ustawienia motywu
include 'lib/options/options.php';
// Projekt
include 'lib/projects/post-type.php';
include 'lib/projects/project.php';
include 'lib/projects/attachments.php';
include 'lib/projects/utils.php';
// Posts
include 'lib/posts/post.php';
include 'lib/posts/utils.php';
include 'lib/posts/ajax.php';
// Członkowie
include 'lib/members/profile.php';
include 'lib/members/capabilities.php';
include 'lib/members/utils.php';
include 'lib/members/ajax.php';
// Sponsorzy
include 'lib/sponsors/post-type.php';
include 'lib/sponsors/utils.php';
// Ogólne
include 'lib/general/removes.php';
include 'lib/general/utils.php';
include 'lib/general/meta-tags.php';
include 'lib/general/slider.php';
include 'lib/general/lazy.php';
include 'lib/general/dashboard.php';
include 'lib/general/setup.php';
include 'lib/general/walker.php';
include 'lib/general/humans.php';
// Login
include 'lib/login/login.php';
// ULTRON
include 'lib/ultron/ultron.php';
// Synergiczne style //
function synergia_theme_stylesheets()
{
global $version, $snrg_settings;
$style_path = get_template_directory_uri().'/build/style';
wp_register_style('Titillium', 'https://fonts.googleapis.com/css?family=Titillium+Web:400,400italic,300,700&subset=latin,latin-ext');
wp_register_style('Titillium900', 'https://fonts.googleapis.com/css?family=Titillium+Web:900&subset=latin');
wp_register_style('PTMono', 'https://fonts.googleapis.com/css?family=PT+Mono');
wp_register_style('main', $style_path.'/main.css', array(), $version, 'all');
wp_register_style('prism', $style_path.'/prism-okaidia.css', array(), $version, 'all');
wp_enqueue_style('main');
wp_enqueue_style('Titillium');
wp_enqueue_style('Titillium900');
if (is_singular('project') || is_single()) {
wp_enqueue_style('prism');
}
// if (is_page('recruitment')) {
wp_enqueue_style('PTMono');
// }
}
add_action('wp_enqueue_scripts', 'synergia_theme_stylesheets');
// Synergiczne style dla admin panelu //
add_action('admin_init','synergia_admin_styles');
function synergia_admin_styles() {
global $version;
wp_enqueue_style( 'admin', get_template_directory_uri() . '/build/style/admin.css', array(), $version, 'all');
}
// Synergiczne skrypty //
function js() {
global $version, $snrg_settings;
$js_path = get_template_directory_uri().'/build/js';
$google_map_key = 'AIzaSyD6ovUl5OZwwEa_MzTArrazVuvVtCMH-B8';
wp_register_script('prism', $js_path.'/prism.min.js', '', true);
wp_register_script('main', $js_path.'/main.min.js', array('jquery'), $version, true);
wp_register_script('swipe', $js_path.'/swipe.min.js', array('jquery'), $version, true);
wp_register_script('blazy', $js_path.'/blazy.min.js', array('jquery'), $version, true);
wp_register_script('404', $js_path.'/404.min.js', array('jquery'), $version, true);
wp_register_script('map', 'https://maps.googleapis.com/maps/api/js?key='.$google_map_key, false);
wp_register_script('map_settings',$js_path.'/map.min.js', array('jquery'), $version, true);
if(!is_404()){
wp_enqueue_script('blazy');
wp_enqueue_script('swipe');
wp_enqueue_script('main');
}
if(is_404()){
wp_enqueue_script('404');
}
if(is_page('about')) {
wp_enqueue_script('map');
wp_enqueue_script('map_settings');
}
if (is_singular('project') || is_single()) {
wp_enqueue_script('prism');
}
}
add_action('wp_footer', 'js');
// Dodajemy wsparcie linków RSS //
add_theme_support('automatic-feed-links');