function get_roots_stylesheets() { $options = roots_get_theme_options(); $roots_css_framework = $options['css_grid_framework']; $template_uri = get_template_directory_uri(); $styles = ''; if ($roots_css_framework === 'blueprint') { $styles .= "<link rel=\"stylesheet\" href=\"{$template_uri}/css/blueprint/screen.css\">\n"; } elseif ($roots_css_framework === '960gs_12' || $roots_css_framework === '960gs_16') { $styles .= "<link rel=\"stylesheet\" href=\"{$template_uri}/css/960/reset.css\">\n"; $styles .= "\t<link rel=\"stylesheet\" href=\"{$template_uri}/css/960/text.css\">\n"; $styles .= "\t<link rel=\"stylesheet\" href=\"{$template_uri}/css/960/960.css\">\n"; } elseif ($roots_css_framework === '960gs_24') { $styles .= "<link rel=\"stylesheet\" href=\"{$template_uri}/css/960/reset.css\">\n"; $styles .= "\t<link rel=\"stylesheet\" href=\"{$template_uri}/css/960/text.css\">\n"; $styles .= "\t<link rel=\"stylesheet\" href=\"{$template_uri}/css/960/960_24_col.css\">\n"; } elseif ($roots_css_framework === '1140') { $styles .= "<link rel=\"stylesheet\" href=\"{$template_uri}/css/1140/1140.css\">\n"; } if (class_exists('RGForms')) { $styles .= "\t<link rel=\"stylesheet\" href=\"" . plugins_url() . "/gravityforms/css/forms.css\">\n"; } $styles .= "\t<link rel=\"stylesheet\" href=\"{$template_uri}/css/style.css\">\n"; if ($roots_css_framework === 'blueprint') { $styles .= "\t<!--[if lt IE 8]><link rel=\"stylesheet\" href=\"{$template_uri}/css/blueprint/ie.css\"><![endif]-->\n"; } elseif ($roots_css_framework === '1140') { $styles .= "\t<!--[if lt IE 8]><link rel=\"stylesheet\" href=\"{$template_uri}/css/1140/ie.css\"><![endif]-->\n"; } return $styles; }
function roots_root_relative_attachment_urls() { $roots_options = roots_get_theme_options(); if (!is_feed() && $roots_options['root_relative_urls']) { add_filter('wp_get_attachment_url', 'roots_root_relative_url'); add_filter('wp_get_attachment_link', 'roots_root_relative_url'); } }
function roots_1140_footer_after() { $options = roots_get_theme_options(); $roots_css_framework = $options['css_grid_framework']; if ($roots_css_framework === '1140') { echo "</div><!-- /.row -->"; } }
function roots_theme_options_render_page() { global $roots_css_frameworks; ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php printf(__('%s Theme Options', 'roots'), get_current_theme()); ?> </h2> <?php settings_errors(); ?> <form method="post" action="options.php"> <?php settings_fields('roots_options'); $roots_options = roots_get_theme_options(); $roots_default_options = roots_get_default_theme_options($roots_options['css_framework']); ?> <table class="form-table"> <tr valign="top" class="radio-option"><th scope="row"><?php _e('CSS Grid Framework', 'roots'); ?> </th> <td> <fieldset class="roots_css_frameworks"><legend class="screen-reader-text"><span><?php _e('CSS Grid Framework', 'roots'); ?> </span></legend> <select name="roots_theme_options[css_framework]" id="roots_theme_options[css_framework]"> <?php foreach ($roots_css_frameworks as $css_framework) { ?> <option value="<?php echo esc_attr($css_framework['name']); ?> " <?php selected($roots_options['css_framework'], $css_framework['name']); ?> ><?php echo $css_framework['label']; ?> </option> <?php } ?> </select> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('#main CSS Classes', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('#main CSS Classes', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[main_class]" id="main_class" value="<?php echo esc_attr($roots_options['main_class']); ?> " class="regular-text" /> <br /> <small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['main_class']; ?> </span></small> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('#sidebar CSS Classes', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('#sidebar CSS Classes', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[sidebar_class]" id="sidebar_class" value="<?php echo esc_attr($roots_options['sidebar_class']); ?> " class="regular-text" /> <br /> <small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['sidebar_class']; ?> </span></small> </fieldset> </td> </tr> <?php if ($roots_options['css_framework'] == 'bootstrap') { ?> <tr valign="top"><th scope="row"><?php _e('Bootstrap Javascript Packages', 'roots'); ?> </th> <td> <fieldset class="roots_bootstrap_js"><legend class="screen-reader-text"><span><?php _e('Enable Bootstrap Javascript', 'roots'); ?> </span></legend> <select name="roots_theme_options[bootstrap_javascript]" id="roots_theme_options[bootstrap_javascript]"> <option value="yes" <?php selected($roots_options['bootstrap_javascript'], true); ?> ><?php echo _e('Yes', 'roots'); ?> </option> <option value="no" <?php selected($roots_options['bootstrap_javascript'], false); ?> ><?php echo _e('No', 'roots'); ?> </option> </select> </fieldset> </td> </tr> <?php } ?> <?php if ($roots_options['css_framework'] == 'bootstrap_less') { ?> <tr valign="top"><th scope="row"><?php _e('Bootstrap Javascript Packages', 'roots'); ?> </th> <td> <fieldset class="roots_bootstrap_js"><legend class="screen-reader-text"><span><?php _e('Enable Bootstrap Javascript', 'roots'); ?> </span></legend> <select name="roots_theme_options[bootstrap_less_javascript]" id="roots_theme_options[bootstrap_less_javascript]"> <option value="yes" <?php selected($roots_options['bootstrap_less_javascript'], true); ?> ><?php echo _e('Yes', 'roots'); ?> </option> <option value="no" <?php selected($roots_options['bootstrap_less_javascript'], false); ?> ><?php echo _e('No', 'roots'); ?> </option> </select> </fieldset> </td> </tr> <?php } ?> <tr valign="top"><th scope="row"><?php _e('Google Analytics ID', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('Google Analytics ID', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[google_analytics_id]" id="google_analytics_id" value="<?php echo esc_attr($roots_options['google_analytics_id']); ?> " /> <br /> <small class="description"><?php printf(__('Enter your UA-XXXXX-X ID', 'roots')); ?> </small> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('Enable Root Relative URLs', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('Enable Root Relative URLs', 'roots'); ?> </span></legend> <select name="roots_theme_options[root_relative_urls]" id="roots_theme_options[root_relative_urls]"> <option value="yes" <?php selected($roots_options['root_relative_urls'], true); ?> ><?php echo _e('Yes', 'roots'); ?> </option> <option value="no" <?php selected($roots_options['root_relative_urls'], false); ?> ><?php echo _e('No', 'roots'); ?> </option> </select> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('Cleanup Menu Output', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('Cleanup Menu Output', 'roots'); ?> </span></legend> <select name="roots_theme_options[clean_menu]" id="roots_theme_options[clean_menu]"> <option value="yes" <?php selected($roots_options['clean_menu'], true); ?> ><?php echo _e('Yes', 'roots'); ?> </option> <option value="no" <?php selected($roots_options['clean_menu'], false); ?> ><?php echo _e('No', 'roots'); ?> </option> </select> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('Enable FOUT-B-Gone', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('Enable FOUT-B-Gone', 'roots'); ?> </span></legend> <select name="roots_theme_options[fout_b_gone]" id="roots_theme_options[fout_b_gone]"> <option value="yes" <?php selected($roots_options['fout_b_gone'], true); ?> ><?php echo _e('Yes', 'roots'); ?> </option> <option value="no" <?php selected($roots_options['fout_b_gone'], false); ?> ><?php echo _e('No', 'roots'); ?> </option> </select> </fieldset> </td> </tr> </table> <?php submit_button(); ?> </form> </div> <?php }
// activation require_once get_template_directory() . '/inc/roots-options.php'; // theme options require_once get_template_directory() . '/inc/roots-cleanup.php'; // cleanup require_once get_template_directory() . '/inc/roots-htaccess.php'; // rewrites for assets, h5bp htaccess require_once get_template_directory() . '/inc/roots-hooks.php'; // hooks require_once get_template_directory() . '/inc/roots-actions.php'; // actions require_once get_template_directory() . '/inc/roots-widgets.php'; // widgets require_once get_template_directory() . '/inc/roots-custom.php'; // custom functions $roots_options = roots_get_theme_options(); // set the maximum 'Large' image width to the maximum grid width if (!isset($content_width)) { global $roots_options; $roots_css_framework = $roots_options['css_framework']; switch ($roots_css_framework) { case 'blueprint': $content_width = 950; break; case '960gs_12': $content_width = 940; break; case '960gs_16': $content_width = 940; break; case '960gs_24':
function roots_theme_options_render_page() { global $roots_css_frameworks; global $roots_months; global $roots_days; ?> <div class="wrap" id="roots-options-container"> <?php screen_icon(); ?> <h2><?php printf(__('%s Theme Options', 'roots'), get_current_theme()); ?> </h2> <form method="post" action="options.php"> <div class="metabox-holder"> <div id="options-sidebar"> <ul> <li><a href="#general">Main Content</a></li> <li><a href="#core">Core Settings</a></li> </ul> </div><!-- #options-sidebar --> <div id="roots-options-content"> <?php settings_fields('roots_options'); $roots_options = roots_get_theme_options(); $roots_default_options = roots_get_default_theme_options(); ?> <div class="roots-options-framework" id="general"> <?php settings_errors(); ?> <table class="form-table"> <h2>Main Content</h2> <tr valign="top"><th scope="row"><?php _e('Featured Video', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('Featured Video', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[DAAS_video]" id="DAAS_video" value="<?php echo esc_attr($roots_options['DAAS_video']); ?> " class="regular-text" /> <br /><small class="description">(Enter a valid YouTube URL)</small> </fieldset> </td> </tr> </table> </div> <div class="roots-options-framework" id="core"> <table class="form-table"> <h2>Core Settings</h2> <tr valign="top"><th scope="row"><?php _e('Google Analytics ID', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('Google Analytics ID', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[google_analytics_id]" id="google_analytics_id" value="<?php echo esc_attr($roots_options['google_analytics_id']); ?> " /> <br /> <small class="description"><?php printf(__('Enter your UA-XXXXX-X ID', 'roots')); ?> </small> </fieldset> </td> </tr> </table> </div> </div> <div class="clear"></div> </div> <div class="roots-options-framework-submit"> <?php submit_button('Save All Changes'); ?> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <?php }
function theme_options_render_page() { ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php printf(__('%s Theme Options', 'roots'), get_current_theme()); ?> </h2> <?php settings_errors(); ?> <form method="post" action="options.php"> <?php settings_fields('roots_options'); $options = roots_get_theme_options(); $default_options = roots_get_default_theme_options(); ?> <table class="form-table"> <tr valign="top" class="radio-option"><th scope="row"><?php _e('CSS Grid Framework', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('CSS Grid Framework', 'roots'); ?> </span></legend> <?php foreach (roots_grid_framework() as $grid_framework) { ?> <div class="layout"> <label class="description"> <input type="radio" name="roots_theme_options[css_grid_framework]" value="<?php echo esc_attr($grid_framework['value']); ?> " <?php checked($options['css_grid_framework'], $grid_framework['value']); ?> /> <span> <?php echo $grid_framework['label']; ?> </span> </label> </div> <?php } ?> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('#main CSS Classes', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('#main CSS Classes', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[css_main_class]" id="css_main_class" value="<?php echo esc_attr($options['css_main_class']); ?> " /> <br /> <small class="description"><?php printf(__('Default: %s', 'roots'), $default_options['css_main_class']); ?> </small> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('#sidebar CSS Classes', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('#sidebar CSS Classes', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[css_sidebar_class]" id="css_sidebar_class" value="<?php echo esc_attr($options['css_sidebar_class']); ?> " /> <br /> <small class="description"><?php printf(__('Default: %s', 'roots'), $default_options['css_sidebar_class']); ?> </small> </fieldset> </td> </tr> <tr valign="top"><th scope="row"><?php _e('Google Analytics ID', 'roots'); ?> </th> <td> <fieldset><legend class="screen-reader-text"><span><?php _e('Google Analytics ID', 'roots'); ?> </span></legend> <input type="text" name="roots_theme_options[google_analytics_id]" id="google_analytics_id" value="<?php echo esc_attr($options['google_analytics_id']); ?> " /> <br /> <small class="description"><?php printf(__('Enter your UA-XXXXX-X ID', 'roots')); ?> </small> </fieldset> </td> </tr> </table> <?php submit_button(); ?> </form> </div> <?php }