Skip to content

Commit

Permalink
complete rewrite of theme options, based on twentyeleven (in progress)
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed May 30, 2011
1 parent 251e17b commit 91d81dd
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 209 deletions.
7 changes: 0 additions & 7 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ input::-moz-focus-inner, button::-moz-focus-inner { border: 0; padding: 0; }
.hentry h1 { line-height: 1.2em; margin-bottom: 0.2em; }
.hentry h2:first-child { line-height: 1.2em; margin-bottom: 0; }
.hentry h2 a { text-decoration: none; }
.hentry iframe.twitter-share-button { position: absolute; top: 0; right: 0; width: 110px; height: 20px; }
.hentry time { display: block; font-size: 1.2em; position: relative; }
.hentry p.byline { }

Expand Down Expand Up @@ -219,12 +218,6 @@ figure.gallery-item figcaption { display: none; }

#content-info p.copy small { font-size: 1em; }

#content-info p.social .twitter-share-button { float: left; }
#content-info p.social .fb_iframe_widget { float: left; }

#content-info p.vcard { position: absolute; top: 0; right: 0; margin: 0; text-align: right; }
#content-info p.vcard a.fn { font-size: 14px; }


/* WIDGETS & PLUGINS
--------------------------------------------------------------------------------------------------------------------------------------------------- */
Expand Down
20 changes: 0 additions & 20 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@
<div class="container">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Footer") ) : ?>
<?php endif; ?>

<p class="copy"><small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p>
<?php if (get_option('roots_footer_social_share') == 'checked') { ?>
<p class="social">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php echo home_url('/'); ?>" data-count="horizontal"><?php _e('Tweet', 'roots');?></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo home_url('/'); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=110&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px;" allowTransparency="true"></iframe>
</p>
<?php } ?>
<?php if (get_option('roots_footer_vcard') == 'checked') { ?>
<p class="vcard">
<a class="fn org url" href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a><br>
<span class="adr">
<span class="street-address"><?php echo get_option('roots_vcard_street-address'); ?></span><br>
<span class="locality"><?php echo get_option('roots_vcard_locality'); ?></span>,
<span class="region"><?php echo get_option('roots_vcard_region'); ?></span>
<span class="postal-code"><?php echo get_option('roots_vcard_postal-code'); ?></span><br>
</span>
<span class="tel"><span class="value"><span class="hidden">+1-</span><?php echo get_option('roots_vcard_tel'); ?></span></span><br>
<a class="email" href="mailto:<?php echo get_option('roots_vcard_email'); ?>"><?php echo get_option('roots_vcard_email'); ?></a>
</p>
<?php } ?>
</div>
</footer>
<?php roots_footer_after(); ?>
Expand Down
7 changes: 5 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
$theme_name = next(explode('/themes/', get_template_directory()));

// set the value of the main container class depending on the selected grid framework
$roots_css_framework = get_option('roots_css_framework');
$options = roots_get_theme_options();
$roots_css_framework = $options['css_grid_framework'];
if (!defined('roots_container_class')) {
switch ($roots_css_framework) {
case 'blueprint': define('roots_container_class', 'span-24'); break;
Expand All @@ -27,7 +28,9 @@
}

function get_roots_stylesheets() {
$roots_css_framework = get_option('roots_css_framework');
$options = roots_get_theme_options();
$roots_css_framework = $options['css_grid_framework'];

$template_uri = get_template_directory_uri();
$styles = '';

Expand Down
8 changes: 6 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
<?php roots_head(); ?>

<script src="<?php echo get_template_directory_uri(); ?>/js/scripts.js"></script>
<?php if (get_option('roots_google_analytics') !== "") { ?>
<?php
$options = roots_get_theme_options();
$google_analytics_id = $options['google_analytics_id'];
if ($google_analytics_id !== '') { ?>

<script>
var _gaq=[['_setAccount','<?php echo get_option('roots_google_analytics') ?>'],['_trackPageview'],['_trackPageLoadTime']];
var _gaq=[['_setAccount','<?php echo esc_attr($options['google_analytics_id']); ?>'],['_trackPageview'],['_trackPageLoadTime']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
Expand Down
29 changes: 0 additions & 29 deletions inc/css/options.css

This file was deleted.

Empty file added inc/css/theme-options.css
Empty file.
1 change: 0 additions & 1 deletion inc/js/options.js → inc/js/theme-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ jQuery.noConflict();

jQuery(document).ready(function(){

jQuery("#tabs").tabs();

});
20 changes: 15 additions & 5 deletions inc/roots-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,44 @@
add_action('roots_footer_after', 'roots_1140_footer_after');

function roots_1140_head() {
$options = roots_get_theme_options();
$roots_css_framework = $options['css_grid_framework'];
$template_uri = get_template_directory_uri();
if (get_option('roots_css_framework') === '1140') {
if ($roots_css_framework === '1140') {
echo "<script src=\"$template_uri/js/css3-mediaqueries.js\"></script>";
}
}

function roots_1140_header_before() {
if (get_option('roots_css_framework') === '1140') {
$options = roots_get_theme_options();
$roots_css_framework = $options['css_grid_framework'];
if ($roots_css_framework === '1140') {
echo "<div class=\"row\">";
}
}

function roots_1140_header_after() {
if (get_option('roots_css_framework') === '1140') {
$options = roots_get_theme_options();
$roots_css_framework = $options['css_grid_framework'];
if ($roots_css_framework === '1140') {
echo "</div><!-- /.row -->";
echo "<div class=\"row\">";
}
}

function roots_1140_footer_before() {
if (get_option('roots_css_framework') === '1140') {
$options = roots_get_theme_options();
$roots_css_framework = $options['css_grid_framework'];
if ($roots_css_framework === '1140') {
echo "</div><!-- /.row -->";
echo "<div class=\"row\">";
}
}

function roots_1140_footer_after() {
if (get_option('roots_css_framework') === '1140') {
$options = roots_get_theme_options();
$roots_css_framework = $options['css_grid_framework'];
if ($roots_css_framework === '1140') {
echo "</div><!-- /.row -->";
}
}
Expand Down
Loading

0 comments on commit 91d81dd

Please sign in to comment.