This repository was archived by the owner on Mar 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathfunctions.php
More file actions
185 lines (146 loc) · 5.63 KB
/
functions.php
File metadata and controls
185 lines (146 loc) · 5.63 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
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
<?php
define ( 'ARRAS_CHILD', is_child_theme() );
define ( 'ARRAS_VERSION' , '1.5.3' );
define ( 'ARRAS_LIB', TEMPLATEPATH . '/library' );
do_action('arras_init');
/**
* Theme setup function - to be run during 'after_setup_theme' action hook.
* @since 1.6
*/
add_action( 'after_setup_theme', 'arras_setup' );
if ( !function_exists('arras_setup') ) :
function arras_setup() {
/* Load theme options (to be revamped) */
require_once ARRAS_LIB . '/admin/options.php';
require_once ARRAS_LIB . '/admin/templates/functions.php';
arras_flush_options();
/* Load theme library files */
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 . '/styles.php';
require_once ARRAS_LIB . '/slideshow.php';
require_once ARRAS_LIB . '/widgets.php';
if ( is_admin() ) {
require_once ARRAS_LIB . '/admin/admin.php';
}
//require_once ARRAS_LIB . '/admin/background.php';
/* Post meta fields */
define( 'ARRAS_REVIEW_SCORE', 'score' );
define( 'ARRAS_REVIEW_PROS', 'pros' );
define( 'ARRAS_REVIEW_CONS', 'cons' );
define( 'ARRAS_CUSTOM_FIELDS', false );
/* Langauge support */
load_theme_textdomain( 'arras', TEMPLATEPATH . '/language' );
$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );
/* Theme support */
add_theme_support('post-thumbnails');
add_theme_support('nav-menus');
add_theme_support('automatic-feed-links');
add_theme_support('custom-background');
/* Menus locations */
register_nav_menus(array(
'main-menu' => __('Main Menu', 'arras'),
'top-menu' => __('Top Menu', 'arras')
));
/* Thumbnail sizes */
arras_add_default_thumbnails();
/* Register sidebars */
arras_add_sidebars();
/* Custom layouts & styles */
if ( !defined('ARRAS_INHERIT_STYLES') || ARRAS_INHERIT_STYLES == true ) {
add_action( 'arras_custom_styles', 'arras_layout_styles' );
}
if ( !defined('ARRAS_INHERIT_LAYOUT') || ARRAS_INHERIT_LAYOUT == true ) {
// Alternate Styles & Layouts
register_alternate_layout( '1c-fixed', __('1 Column Layout (No Sidebars)', 'arras') );
register_alternate_layout( '2c-r-fixed', __('2 Column Layout (Right Sidebar)', 'arras') );
register_alternate_layout( '2c-l-fixed', __('2 Column Layout (Left Sidebar)', 'arras') );
register_alternate_layout( '3c-fixed', __('3 Column Layout (Left & Right Sidebars)', 'arras') );
register_alternate_layout( '3c-r-fixed', __('3 Column Layout (Right Sidebars)', 'arras') );
register_style_dir( TEMPLATEPATH . '/css/styles/' );
}
/* Header actions */
remove_action( 'wp_head', 'pagenavi_css' );
add_action( 'arras_head', 'arras_override_styles' );
add_action( 'arras_custom_styles', 'arras_add_custom_logo' );
add_action( 'arras_custom_styles', 'arras_constrain_footer_sidebars' );
add_action( 'arras_beside_nav', 'arras_social_nav' );
add_action( 'wp_head', 'arras_load_styles', 1 );
add_action( 'wp_head', 'arras_head' );
add_action( 'wp_head', 'arras_add_facebook_share_meta' );
add_action( 'wp_head', 'arras_add_header_js' );
add_action( 'wp_footer', 'arras_add_footer_js' );
/* Filters */
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' );
}
/* Admin actions */
if (is_admin()) {
add_action( 'admin_menu', 'arras_addmenu' );
}
/* Max image size */
$max_image_size = arras_get_single_thumbs_size();
$content_width = $max_image_size[0];
/* For child themes overrides */
do_action( 'arras_setup' );
// print_r($arras_options);
}
endif;
/**
* Sidebar setup function.
* @since 1.6
*/
function arras_add_sidebars() {
/* Default sidebars */
register_sidebar( array(
'name' => 'Primary Sidebar',
'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer clearfix">',
'after_widget' => '</li>',
'before_title' => '<h5 class="widgettitle">',
'after_title' => '</h5>'
) );
register_sidebar( array(
'name' => 'Secondary Sidebar #1',
'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer clearfix">',
'after_widget' => '</li>',
'before_title' => '<h5 class="widgettitle">',
'after_title' => '</h5>'
) );
register_sidebar( array(
'name' => 'Bottom Content #1',
'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer clearfix">',
'after_widget' => '</li>',
'before_title' => '<h5 class="widgettitle">',
'after_title' => '</h5>'
) );
register_sidebar( array(
'name' => 'Bottom Content #2',
'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer clearfix">',
'after_widget' => '</li>',
'before_title' => '<h5 class="widgettitle">',
'after_title' => '</h5>'
) );
/* Footer sidebars (Up to 4 sidebars based on user preference) */
$footer_sidebars = arras_get_option('footer_sidebars');
if ($footer_sidebars == '') $footer_sidebars = 1;
for( $i = 1; $i < $footer_sidebars + 1; $i++ ) {
register_sidebar( array(
'name' => 'Footer Sidebar #' . $i,
'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer clearfix">',
'after_widget' => '</li>',
'before_title' => '<h5 class="widgettitle">',
'after_title' => '</h5>'
) );
}
}
/* End of file functions.php */
/* Location: ./functions.php */