-
Notifications
You must be signed in to change notification settings - Fork 0
Theme activation
Download Roots and upload it to /wp-content/themes/roots/
- then you can activate the theme through the WordPress admin
When you activate Roots we'll automatically create a page called Home with filler content. We then automatically set the Reading Settings of the blog to make the Home page the static frontpage.
If your site isn't going to have a static homepage and instead will be showing your latest posts, you'll need to go into the Reading Settings after theme activation and change this.
Roots will automatically set the permalink structure to /%postname%/
.
Instead of the default /wp-content/uploads/
we tell WordPress to use simply /assets/
and to not organize uploads by year and month.
Roots comes with one navigation by default. We create the menu, automatically set it's location, and then add all current pages to the Navigation.
Unlike previous versions of Roots theme, as of v5 there is no theme options page within the Wordpress Admin area. Instead, to add your (optional) Google Analytics code, edit this section of the inc/roots-config.php file like so:
define('GOOGLE_ANALYTICS_ID', 'YOUR CODE HERE');
The preferred option of loading additional JavaScript files is through the inc/roots-scripts.php file. For example, here we have amended the standard version of the file (as of v.5.0) to illustrate how to add an additional jQuery file, only if not in the Admin area and on a page called 'Page1', 'Page2' or 'Page3':
function roots_scripts() {
$template_uri = get_template_directory_uri();
wp_register_script('roots_plugins', ''.$template_uri.'/js/plugins.js', false, null, false);
wp_register_script('roots_script', ''.$template_uri.'/js/script.js', false, null, false);
wp_enqueue_script('roots_plugins');
wp_enqueue_script('roots_script');
// additional section to illustrate how to add additional JS files
if ( !is_admin() && is_page(array('Home','Design','Writing')) ) {
wp_register_script('roots_list', ''.$template_uri.'/js/replaceList.js', false, null, false);
wp_enqueue_script('roots_list');
}
// end of changes to standard version of file
}
If you want to remove the default styles that load with Roots, amend the following code in inc/roots-actions.php
function roots_get_stylesheets() {
$styles = '';
$styles .= stylesheet_link_tag('/style.css', 1);
//$styles .= stylesheet_link_tag('/bootstrap.css', 1);
if (BOOTSTRAP_RESPONSIVE) {
// $styles .= stylesheet_link_tag('/bootstrap-responsive.css', 1);
}
// $styles .= stylesheet_link_tag('/app.css', 1);
if (is_child_theme()) {
$styles .= "\t<link rel=\"stylesheet\" href=\"" . get_stylesheet_uri(). "\">\n";
}
echo $styles;
}