This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
269 lines (233 loc) · 7.55 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?php
/**
* fungsi dasar
**/
require get_template_directory() . '/inc/_dy-helper.php';
/**
* fungsi conf
**/
require get_template_directory() . '/inc/_dy-helper-conf.php';
/**
* fungsi untuk melakukan setup
**/
require get_template_directory() . '/inc/_dy-setup.php';
/**
* fungsi untuk widget
**/
require get_template_directory() . '/inc/_dy-widget.php';
/**
* fungsi untuk keamanan
**/
require get_template_directory() . '/inc/_dy-security.php';
/**
* fungsi untuk meload assets
**/
require get_template_directory() . '/inc/_dy-enqueue.php';
/**
* fungsi untuk memanipulasi format
**/
require get_template_directory() . '/inc/_dy-format.php';
/**
*
**/
require get_template_directory() . '/inc/functions-customize.php';
// count posts per format-post
// function count_post_per_format($format, $operator){
// $argumens = array(
// 'tax_query' => array(
// array(
// 'taxonomy' => 'post_format',
// 'field' => 'slug',
// 'terms' => $format,
// 'operator' => $operator
// )
// ),'posts_per_page' => -1
// );
// $total_post = count(query_posts( $argumens ));
// return $total_post;
// }
// show posts per format-post
// function filter_post_per_format($format = array(), $operator){
// $argumens = array('tax_query' => array(
// array(
// 'taxonomy' => 'post_format',
// 'field' => 'slug',
// 'terms' => $format,
// 'operator' => $operator,
// ),
// ), 'posts_per_page' => 3 );
// return query_posts( $argumens );
// }
// function url_share($social_media){
// switch ($social_media) {
// case "facebook":
// $link = "https://www.facebook.com/sharer/sharer.php?u=";
// return $link;
// break;
// case "google_plus":
// $link = "https://plus.google.com/share?url=";
// return $link;
// break;
// case "linkedin":
// $link = "https://www.linkedin.com/shareArticle?mini=true&url=";
// return $link;
// break;
// case "twitter":
// $link = "http://twitter.com/share?url=";
// return $link;
// break;
// default:
// echo "Your favorite color is neither red, blue, nor green!";
// }
// }
// function share_post_to($social_media, $url_post = "http://www.kang-cahya.com/", $target = ""){
// switch ($social_media) {
// case "facebook":
// $link = " <a href='https://www.facebook.com/sharer/sharer.php?u=".$url_post."' target='".$target."'><i class='fa fa-facebook'></i></a> ";
// echo $link;
// return $link;
// break;
// case "google_plus":
// $link = " <a href='https://plus.google.com/share?url=".$url_post."' target='".$target."'><i class='fa fa-google-plus'></i></a> ";
// echo $link;
// return $link;
// break;
// case "linkedin":
// $link = " <a href='https://www.linkedin.com/shareArticle?mini=true&url=".$url_post."&summary=' target='".$target."'><i class='fa fa-linkedin'></i></a> ";
// echo $link;
// return $link;
// break;
// case "twitter":
// $link = " <a href='http://twitter.com/share?url=".$url_post."' target='".$target."'><i class='fa fa-twitter'></i></a> ";
// echo $link;
// return $link;
// break;
// default:
// $link = " <a href='https://www.facebook.com/sharer/sharer.php?u=http://www.kang-cahya.com/' target='".$target."'><i class='fa fa-facebook'></i></a> ";
// echo $link;
// return $link;
// }
// }
// function share_post_to_c($social_media, $url_post = "http://www.kang-cahya.com/", $target = ""){
// switch ($social_media) {
// case "facebook":
// $link = " <a href='https://www.facebook.com/sharer/sharer.php?u=".$url_post."' target='".$target."' class='btn btn-primary'><i class='fa fa-facebook'></i></a> ";
// echo $link;
// return $link;
// break;
// case "google_plus":
// $link = " <a href='https://plus.google.com/share?url=".$url_post."' target='".$target."' class='btn btn-danger'><i class='fa fa-google-plus'></i></a> ";
// echo $link;
// return $link;
// break;
// case "linkedin":
// $link = " <a href='https://www.linkedin.com/shareArticle?mini=true&url=".$url_post."&summary=' target='".$target."' class='btn btn-primary'><i class='fa fa-linkedin'></i></a> ";
// echo $link;
// return $link;
// break;
// case "twitter":
// $link = " <a href='http://twitter.com/share?url=".$url_post."' target='".$target."' class='btn btn-info'><i class='fa fa-twitter'></i></a> ";
// echo $link;
// return $link;
// break;
// default:
// $link = " <a href='https://www.facebook.com/sharer/sharer.php?u=http://www.kang-cahya.com/' target='".$target."' class='btn btn-primary'><i class='fa fa-facebook'></i></a> ";
// echo $link;
// return $link;
// }
// }
// function limit_show_post_today(){
// return 2;
// }
// function post_format_icon($format){
// if($format == "aside"){ return "<i class='md md-receipt'></i>"; }
// elseif($format == "chat"){ return "<i class=''></i>"; }
// elseif($format == "gallery"){ return "<i class=''></i>"; }
// elseif($format == "link"){ return "<i class='md md-link'></i>"; }
// elseif($format == "image"){ return "<i class=''></i>"; }
// elseif($format == "quote"){ return "<i class='md md-format-quote'></i>"; }
// elseif($format == "status"){ return "<i class=''></i>"; }
// elseif($format == "video"){ return "<i class=''></i>"; }
// elseif($format == "audio"){ return "<i class=''></i>";}
// else{ return "<i class='md md-pin-drop'></i>"; }
// }
// function post_slider(){
// query_posts('posts_per_page=6');
// if( have_posts() ){
// while( have_posts() ){ the_post();
// $slide = get_template_part('template/gut-content-owlslider');
// echo $slide;
// }
// } else {
// $slide = "<div class='not-found'>Slide Not Found</div>";
// echo $slide;
// }
// return $slide;
// }
// function post_datatable(){
// query_posts(array('posts_per_page' => 10000000));
// if( have_posts() ){
// while( have_posts() ){ the_post();
// $rows = "<tr>
// <td><a href='".get_the_permalink()."'>".get_the_title()."</a></td>
// <td>".get_the_author()."</td>
// <td>".get_the_time('F, d Y H:i:s A')."</td>
// </tr>";
// echo $rows;
// }
// } else {
// $rows = "<tr><td>Records Not Found</td></tr>";
// echo $rows;
// }
// return $rows;
// }
// function archive_author(){
// if( have_posts() ){
// while( have_posts() ){ the_post();
// $post_author = get_template_part('template/gut-content-author');
// echo $post_author;
// }
// } else {
// $post_author = "<div class='not-found'>Post Not Found</div>";
// echo $post_author;
// }
// return $post_author;
// }
// function gut_dir_t($param){
// switch ($param) {
// case "homepage":
// $dir = "template/homepage/";
// return $dir;
// break;
// default:
// $dir = "template/";
// return $dir;
// }
// }
// function gut_template(){
// $templ = get_template_part('template/gut-content', get_post_format());
// echo $templ;
// return $templ;
// }
// function cut_title_post($data_leng){
// $leng = strlen($data_leng);
// if($leng <= 14){
// $cut = strtolower($data_leng);
// echo $cut;
// return $cut;
// }else{
// $cut = strtolower(substr($data_leng, 0, 14)."...");
// echo $cut;
// return $cut;
// }
// }
// function footer_x(){
// $by = "
// <footer class='footer text-right'>
// 2015 © GUT Theme.
// </footer>
// ";
// echo $by;
// return $by;
// }
?>