-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
executable file
·169 lines (134 loc) · 5.24 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
function uka_widgets_init(){
register_sidebar(array(
'name' => __('Home top left', 'uka'),
'id' => 'home-top-left',
'description' => __('Add widgets here to appear top left.', 'uka'),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
));
register_sidebar(array(
'name' => __('Home top right', 'uka'),
'id' => 'home-top-right',
'description' => __('Add widgets here to appear top right.', 'uka'),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
));
register_sidebar(array(
'name' => __('Home bottom left', 'uka'),
'id' => 'home-bottom-left',
'description' => __('Add widgets here to appear bottom left.', 'uka'),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
));
register_sidebar(array(
'name' => __('Home bottom right', 'uka'),
'id' => 'home-bottom-right',
'description' => __('Add widgets here to appear bottom right.', 'uka'),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
));
}
add_action('widgets_init', 'uka_widgets_init');
if (! function_exists('uka_setup')):
function uka_setup(){
//define("CHARSET", "utf-8");
date_default_timezone_set('Europe/Oslo');
#setlocale(LC_ALL, 'nb_NO', 'nb_no', 'nb', 'no', 'norwegian', 'nb_NO.UTF-8');
setlocale(LC_ALL, 'nb_NO.UTF-8');
register_nav_menus(array(
'main-menu' => __('Main menu', 'uka'),
));
register_nav_menus(array(
'footer-menu' => __('Footer menu', 'uka'),
));
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support('post-thumbnails');
set_post_thumbnail_size(432, 0);
update_option( 'thumbnail_size_w', 144 );
update_option( 'thumbnail_size_h', 0 );
update_option( 'medium_size_w', 288 );
update_option( 'medium_size_h', 0 );
//update_option( 'medium_large_size_w', 300 );
//update_option( 'medium_large_size_h', 0 );
update_option( 'large_size_w', 576 );
update_option( 'large_size_h', 0 );
add_theme_support('post-formats', array('link'));
}
add_action('after_setup_theme', 'uka_setup');
endif; // uka_setup
function custom_excerpt_length( $length ) {
return 0;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function uka_scripts(){
wp_deregister_script('jquery');
wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-3.1.1.min.js');
wp_enqueue_script('uka-wordpress-script', get_template_directory_uri() . '/js/uka-wordpress.js?t='.time(), array('jquery'));
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/lib/font-awesome/css/font-awesome.min.css', array(), '4.7.0');
wp_enqueue_style('normalize', get_template_directory_uri() . '/css/normalize.css', array(), '5.0.0');
// Theme stylesheet.
wp_enqueue_style('uka-style', get_stylesheet_uri().'?t='.time(), array('normalize'));
}
add_action('wp_enqueue_scripts', 'uka_scripts');
/**
* Plugin additions.
*/
require(get_template_directory().'/inc/plugins/uka-seo/uka-seo-plugin.php');
require(get_template_directory().'/inc/plugins/uka-program/uka-program-plugin.php');
require(get_template_directory().'/inc/plugins/uka-panels/uka-panels-plugin.php');
/**
* Widget additions.
*/
require(get_template_directory().'/inc/widgets/social-icons/social-icons.php');
require(get_template_directory().'/inc/widgets/instagram/instagram.php');
require(get_template_directory().'/inc/widgets/uka-wordcloud/uka-wordcloud-widget.php');
require(get_template_directory().'/inc/widgets/uka-news/uka-news.php');
/**
* Customizer additions.
*/
require(get_template_directory().'/inc/customizer.php');
/**
* Remove categories
*/
function uka_remove_categories(){
register_taxonomy('category', array());
}
add_action('init', 'uka_remove_categories');
/**
* Remove unused Wordpress widgets
*/
function uka_remove_widgets(){
register_taxonomy('category', array());
unregister_widget('WP_Widget_Categories');
unregister_widget('WP_Widget_RSS');
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Widget_Search');
unregister_widget('WP_Widget_Text');
unregister_widget('WP_Widget_Recent_Posts');
unregister_widget('WP_Widget_Recent_Comments');
unregister_widget('WP_Widget_Tag_Cloud');
unregister_widget('WP_Nav_Menu_Widget');
}
add_action('widgets_init', 'uka_remove_widgets');
function my_function_admin_bar(){
return false;
}
//add_filter( 'show_admin_bar' , 'my_function_admin_bar');
?>