-
Notifications
You must be signed in to change notification settings - Fork 7
/
init.php
143 lines (133 loc) · 4.25 KB
/
init.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
<?php
/**
* This file is where you configure content types, taxonomies, navigations, and
* just about all of the WP related things! It all happens here.
*/
use Rye\Rye;
/**
* Set domains and any other constants here.
*/
define("PRODUCTION_SERVER", "my-production-site.com");
define("STAGING_SERVER", "my-staging-site.com");
/**
* Set the enviornment property. This will determine which version of the
* assets will be used.
*/
if (stripos($_SERVER['SERVER_NAME'], PRODUCTION_SERVER) !== false) {
Rye::$enviornment = Rye::PRODUCTION;
} else if (stripos($_SERVER['SERVER_NAME'], STAGING_SERVER) !== false) {
Rye::$enviornment = Rye::STAGING;
} else {
Rye::$enviornment = Rye::DEVELOPMENT;
}
/**
* Site configurations.
*/
Rye::init(array(
/**
* Path to JavaScript files. Notice that vendor libraries are left separate
* from the custom compiled script. This allows for better compatibility with
* other plugins.
* http://codex.wordpress.org/Function_Reference/wp_register_script
*/
'javascripts' => array(
'jquery' => 'https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js',
'main' => sprintf(
'%s/assets/dist/%s%s',
get_bloginfo('template_directory'),
Rye::projectName(),
((Rye::$enviornment < Rye::STAGING) ? '.min' : '') . '.js'
)
),
/**
* Path to JavaScript files.
* http://codex.wordpress.org/Function_Reference/add_image_size
*
* '<image-size-name>' => array(<width>, <height>, <crop>)
*/
'image_sizes' => array(
/*
'featured_post' => array(500, 500, false),
'featured_article' => array(200, 200, true)
*/
),
/**
* Declare custom menu regions.
* http://codex.wordpress.org/Function_Reference/register_nav_menus
*/
'menus' => array(
/*
'main-nav' => 'Main Navigation',
'sub-nav' => 'Sub Navigation',
*/
),
/**
* Declare theme features.
* http://codex.wordpress.org/Function_Reference/add_theme_support
*
* '<feature>' => array('<arg>', '<arg>')
*/
'theme_support' => array(
/*
'html5' => array('search-form', 'comment-form', 'comment-list'),
'post-thumbnails' => array('post', 'articles'),
'post-formats' => array('aside', 'gallery')
*/
),
/**
* Declare "widgetized" regions.
* http://codex.wordpress.org/Function_Reference/register_sidebar
*/
'widgetized_regions' => array(
/*
array(
'name' => '<Region Name>',
'description' => '<Region Description>',
'before_title' => '<h2>',
'after_title' => '</h2>',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
),
array(
'name' => '<Region Name>',
'description' => '<Region Description>',
'before_title' => '<h2>',
'after_title' => '</h2>',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
)
*/
),
/**
* Declare custom post types.
* http://codex.wordpress.org/Function_Reference/register_post_type
*/
'post_types' => array(
/*
'some_type' => array(
'labels' => array('name' => 'Some Type'),
'public' => true,
'rewrite' => true,
'has_archive' => true,
'supports' => array('title', 'thumbnail', 'editor')
)
*/
),
/**
* Declare custom taxonomies.
* http://codex.wordpress.org/Function_Reference/register_taxonomy
*/
'taxonomies' => array(
/*
array(
'tax_name', 'postype_name', array(
'hierarchical' => false,
'labels' => array('name' => '<Tax Name>'),
'show_ui' => true,
'query_var' => true,
'rewrite' => array('slug' => 'tax-name'),
)
)
*/
)
));