-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
202 lines (155 loc) · 5.13 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
// menu
function register_my_menus() {
register_nav_menus(
array(
'header-menu' => __( 'Top Menu' ),
'extra-menu-1' => __( 'Bar menu 1' ),
'extra-menu-2' => __( 'Bar menu 2' ),
'extra-menu-3' => __( 'Bar menu 3' ),
'extra-menu-4' => __( 'Bar menu 4' ),
)
);
}
add_action( 'init', 'register_my_menus' );
function starter_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, NULL, true );
wp_enqueue_script( 'jquery' );
}
add_action( 'wp_enqueue_scripts', 'starter_scripts' );
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
add_action('wp_footer', 'print_emoji_detection_script', 7);
function top_menu_args($variabile) {
$defaults = array(
'theme_location' => $variabile,
'menu' => '',
'container' => 'nav',
'container_class' => '',
'container_id' => '',
'menu_class' => '',
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
);
return $defaults;
}
function bot_menu_args($variabile) {
$defaults = array(
'theme_location' => $variabile,
'menu' => '',
'container' => 'nav',
'container_class' => '',
'container_id' => '',
'menu_class' => '',
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="footer_stuffs %2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
);
return $defaults;
}
//
function custom_theme_setup() {
add_theme_support( 'post-thumbnails' );
}
add_action( 'after_setup_theme', 'custom_theme_setup' );
function test($test) {
echo "<pre>";
print_r($test);
echo "</pre>";
}
function work_search_form( $form ) {
$form = '
<form role="search" method="get" id="searchform" action="'.home_url( '/' ).'">
<div class="input-group">
<input type="text" value="' . get_search_query() . '" name="s" id="s" class="form-control screen-reader-text" placeholder="Cerca...">
<span class="input-group-btn">
<input class="btn btn-default" type="submit" id="searchsubmit" value="'. esc_attr__( 'Cerca' ) .'" >
</span>
</div><!-- /input-group -->
</form>';
return $form;
}
add_filter( 'get_search_form', 'work_search_form' );
function arphabet_widgets_init() {
register_sidebar( array(
'name' => 'Avvisi',
'id' => 'avvisi',
'before_widget' => '<aside class=" block"><div class=" col-md-12">',
'after_widget' => '</div><div class="clearfix"></div></aside>
</aside>',
'before_title' => '<h3 class="dashBoard">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'arphabet_widgets_init' );
function footer_widget() {
register_sidebar( array(
'name' => 'Footer',
'id' => 'footer',
'before_widget' => '<div class="col-md-6"><div class="footer-block">',
'after_widget' => '</div></div>',
'before_title' => '<h3 class="footer_title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'footer_widget' );
function sidebar_12() {
register_sidebar( array(
'name' => 'Sidebar_12',
'id' => 'sidebar_12',
'before_widget' => '<aside class=" block"><div class="col-md-12">',
'after_widget' => '</div>
<div class="clearfix"></div></aside>',
'before_title' => '<h3 class="sidebar_12">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'sidebar_12' );
function sidebar_6() {
register_sidebar( array(
'name' => 'Sidebar_6',
'id' => 'sidebar_6',
'before_widget' => '<div class="col-md-6"><aside class=" block"><div class="col-md-12">',
'after_widget' => '</div><div class="clearfix"></div></aside></div>',
'before_title' => '<h3 class="sidebar_6">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'sidebar_6' );
///////////////////////
// Extra per il tema //-------------------------------------[
///////////////////////
function donami_cose() {
$donatutto = '
<div class="compramiCose">
<strong>Offrimi un caffè?</strong>
<small>Qui da noi il caffè costa poco, basta solo un euro!</small>
<span class="compramiWrapper"><input id="compramicose" type="number" value="1"><span>€</span></span>
<span id="liveCompramicose">Dona<a href="http://paypal.me/Irsuti/1" title="Donazione" target="_blank"></a>
</span>
</div>
';
return $donatutto;
}
add_shortcode("donami_cose", "donami_cose");
add_filter('widget_text', 'do_shortcode');
///////////////////////
// Extra per il tema //-------------------------------------]
///////////////////////