-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
executable file
·104 lines (94 loc) · 2.34 KB
/
functions.php
File metadata and controls
executable file
·104 lines (94 loc) · 2.34 KB
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
<?php
//mostro gli errori
$display_errors = true;
if($display_errors) { //mostro gli errori
error_reporting(E_ALL);
ini_set('display_errors', 1);
}
//apro la sessione
//session_start();
//importa le funzioni wordpress
$path = get_template_directory().'/lib/wp-functions/';
if(file_exists($path)) {
$open = opendir($path);
while(false !== ($file = readdir($open))) {
if($file != '.' && $file != '..') {
require('lib/wp-functions/'.$file);
}
}
}
//importa le funzioni
$path = get_template_directory().'/lib/functions/';
if(file_exists($path)) {
$open = opendir($path);
while(false !== ($file = readdir($open))) {
if($file != '.' && $file != '..') {
require('lib/functions/'.$file);
}
}
}
//importa i post type
$path = get_template_directory().'/lib/post-types/';
if(file_exists($path)) {
$open = opendir($path);
while(false !== ($file = readdir($open))) {
if($file != '.' && $file != '..') {
require('lib/post-types/'.$file);
}
}
}
//importa i meta
$path = get_template_directory().'/lib/metas/';
if(file_exists($path)) {
$open = opendir($path);
while(false !== ($file = readdir($open))) {
if($file != '.' && $file != '..') {
require('lib/metas/'.$file);
}
}
}
//importa le pagine dell'admin
$path = get_template_directory().'/lib/admin-pages/';
if(file_exists($path)) {
$open = opendir($path);
while(false !== ($file = readdir($open))) {
if($file != '.' && $file != '..') {
require('lib/admin-pages/'.$file);
}
}
}
//importa le sidebar
function register_theme_sidebars() {
$path = get_template_directory().'/lib/sidebars/';
$files = array();
if(file_exists($path)) {
$open = opendir($path);
while(false !== ($file = readdir($open))) {
if($file != '.' && $file != '..') {
$files[] = $file;
}
}
}
asort($files); //ordino
foreach($files as $file) {
require('lib/sidebars/'.$file);
}
}
add_action('widgets_init', 'register_theme_sidebars');
//importa i widget
function register_theme_widgets() {
$path = get_template_directory().'/lib/widgets/';
if(file_exists($path)) {
$open = opendir($path);
while(false !== ($file = readdir($open))) {
if($file != '.' && $file != '..') {
require('lib/widgets/'.$file);
}
}
}
}
add_action('widgets_init', 'register_theme_widgets');
// Breadcrumbs
require('lib/breadcrumb.php'); //funzioni custom
//altri file
require('lib/custom.php'); //funzioni custom