This repository was archived by the owner on Dec 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathfunctions.php
More file actions
98 lines (76 loc) · 2.77 KB
/
functions.php
File metadata and controls
98 lines (76 loc) · 2.77 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
<?php
namespace Arras;
use Arras\Theme;
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Oops! Something went wrong.' );
}
require_once 'vendor/autoload.php';
initConstants();
require_once ARRAS_LIB . '/admin/options.php';
require_once ARRAS_LIB . '/admin/templates/functions.php';
require_once ARRAS_LIB . '/admin/update.php';
arras_flush_options();
require_once ARRAS_LIB . '/actions.php';
require_once ARRAS_LIB . '/deprecated.php';
require_once ARRAS_LIB . '/filters.php';
require_once ARRAS_LIB . '/tapestries.php';
require_once ARRAS_LIB . '/template.php';
require_once ARRAS_LIB . '/thumbnails.php';
require_once ARRAS_LIB . '/slideshow.php';
require_once ARRAS_LIB . '/widgets.php';
if ( is_admin() ) {
require_once ARRAS_LIB . '/admin/admin.php';
}
initArras();
function initConstants() {
$theme = wp_get_theme();
define( 'ARRAS_VERSION', $theme->get( 'Version' ) );
define( 'ARRAS_URL', $theme->get( 'ThemeURI' ) );
define( 'ARRAS_CONFIG_DIR', get_template_directory() . '/config' );
define( 'ARRAS_LIB', get_template_directory() . '/library' );
define( 'ARRAS_ASSET_URL', get_template_directory_uri() . '/assets' );
define( 'ARRAS_REVIEW_SCORE', 'score' );
define( 'ARRAS_REVIEW_PROS', 'pros' );
define( 'ARRAS_REVIEW_CONS', 'cons' );
define( 'ARRAS_CHILD', is_child_theme() );
}
function initArras() {
$theme = new Theme( include ARRAS_CONFIG_DIR . '/config.php' );
do_action( 'arras_init', $theme );
$theme->init();
}
add_action( 'after_setup_theme', __NAMESPACE__ . '\arras_setup' );
function arras_setup() {
load_theme_textdomain( 'arras', get_template_directory() . '/language' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'nav-menus' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'custom-background' );
add_theme_support( 'custom-logo', [
'height' => 125,
'width' => 400,
'flex-width' => true,
'header-text' => [ 'blog-name' ],
] );
register_nav_menus( array(
'main-menu' => __( 'Main Menu', 'arras' ),
'top-menu' => __( 'Top Menu', 'arras' )
) );
arras_add_default_thumbnails();
arras_add_sidebars();
remove_action( 'wp_head', 'pagenavi_css' );
add_action( 'arras_beside_nav', 'arras_social_nav' );
add_action( 'wp_head', 'arras_head' );
add_action( 'wp_head', 'arras_add_header_js' );
add_action( 'wp_footer', 'arras_add_footer_js' );
add_filter( 'arras_postheader', 'arras_post_taxonomies' );
add_filter( 'gallery_style', 'remove_gallery_css' );
if ( defined( 'ARRAS_CUSTOM_FIELDS' ) && ARRAS_CUSTOM_FIELDS == true ) {
add_filter( 'arras_postheader', 'arras_postmeta' );
}
if ( is_admin() ) {
add_action( 'admin_menu', 'arras_addmenu' );
}
do_action( 'arras_setup' );
}