- Create lib/rewrites.php and move everything from lib/htaccess.php
except the H5BP htaccess functionality into it
- In the config, change add_theme_support('rewrite-urls') to
add_theme_support('rewrites')
- Remove the Apache/LightSpeed HTTPD check for rewrites
- Update docs with better Nginx rewrite rules
74 lines
2.0 KiB
PHP
74 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* Roots configuration
|
|
*/
|
|
|
|
// Enable theme features
|
|
add_theme_support('root-relative-urls'); // Enable relative URLs
|
|
add_theme_support('rewrites'); // Enable URL rewrites
|
|
add_theme_support('h5bp-htaccess'); // Enable HTML5 Boilerplate's .htaccess
|
|
add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's fixed navbar
|
|
add_theme_support('nice-search'); // Enable /?s= to /search/ redirect
|
|
|
|
/**
|
|
* Define which pages shouldn't have the sidebar
|
|
*
|
|
* See lib/sidebar.php for more details
|
|
*/
|
|
function roots_display_sidebar() {
|
|
$sidebar_config = new Roots_Sidebar(
|
|
/**
|
|
* Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
|
|
* Any of these conditional tags that return true won't show the sidebar
|
|
*
|
|
* To use a function that accepts arguments, use the following format:
|
|
*
|
|
* array('function_name', array('arg1', 'arg2'))
|
|
*
|
|
* The second element must be an array even if there's only 1 argument.
|
|
*/
|
|
array(
|
|
'is_404',
|
|
'is_front_page'
|
|
),
|
|
/**
|
|
* Page template checks (via is_page_template())
|
|
* Any of these page templates that return true won't show the sidebar
|
|
*/
|
|
array(
|
|
'page-custom.php'
|
|
)
|
|
);
|
|
|
|
return $sidebar_config->display;
|
|
}
|
|
|
|
// #main CSS classes
|
|
function roots_main_class() {
|
|
if (roots_display_sidebar()) {
|
|
$class = 'span8';
|
|
} else {
|
|
$class = 'span12';
|
|
}
|
|
|
|
return $class;
|
|
}
|
|
|
|
// #sidebar CSS classes
|
|
function roots_sidebar_class() {
|
|
return 'span4';
|
|
}
|
|
|
|
// Configuration values
|
|
define('GOOGLE_ANALYTICS_ID', ''); // UA-XXXXX-Y
|
|
define('POST_EXCERPT_LENGTH', 40);
|
|
|
|
/**
|
|
* $content_width is a global variable used by WordPress for max image upload sizes
|
|
* and media embeds (in pixels).
|
|
*
|
|
* Example: If the content area is 640px wide, set $content_width = 620; so images and videos will not overflow.
|
|
* Default: 940px is the default Bootstrap container width.
|
|
*/
|
|
if (!isset($content_width)) { $content_width = 940; }
|