Skip to content

Commit

Permalink
remove some crufty theme options, break out navigation options into a…
Browse files Browse the repository at this point in the history
… separate tab, remove the sidebar scroll and fade/showey_hidey option
  • Loading branch information
rnagle committed Dec 11, 2015
1 parent ed18352 commit cca5b9f
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 94 deletions.
56 changes: 33 additions & 23 deletions inc/enqueue.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* Enqueue all of our javascript and css files
*
* @since 1.0
* @global LARGO_DEBUG
*/
if ( ! function_exists( 'largo_enqueue_js' ) ) {
/**
* Enqueue our core javascript and css files
*
* @since 1.0
* @global LARGO_DEBUG
*/
function largo_enqueue_js() {

/**
Expand All @@ -31,16 +31,26 @@ function largo_enqueue_js() {
if ( is_single() ) {
wp_enqueue_script( 'idTabs', get_template_directory_uri() . '/js/jquery.idTabs.js', array( 'jquery' ), '1.0', true );
}
}
}
add_action( 'wp_enqueue_scripts', 'largo_enqueue_js' );

if ( ! function_exists( 'largo_enqueue_child_theme_css' ) ) {
/**
* Enqueue Largo child theme CSS
*
* @since 0.5.4
*/
function largo_enqueue_child_theme_css() {
//Load the child theme's style.css if we're actually running a child theme of Largo
$theme = wp_get_theme();

if (is_object($theme->parent())) {
wp_enqueue_style( 'largo-child-styles', get_stylesheet_directory_uri() . '/style.css', array('largo-stylesheet'));
}
}
add_action( 'wp_enqueue_script', 'largo_enqueue_child_theme_css' );
}
add_action( 'wp_enqueue_scripts', 'largo_enqueue_js' );

/**
* Enqueue our admin javascript and css files
Expand All @@ -56,13 +66,13 @@ function largo_enqueue_admin_scripts() {
}
add_action( 'admin_enqueue_scripts', 'largo_enqueue_admin_scripts' );

/**
* Determine which size of the banner image to load based on the window width
*
* @since 1.0
* @todo: should probably use picturefill for this instead
*/
if ( ! function_exists( 'largo_header_js' ) ) {
/**
* Determine which size of the banner image to load based on the window width
*
* @since 1.0
* @todo: should probably use picturefill for this instead
*/
function largo_header_js() { ?>
<script>
function whichHeader() {
Expand All @@ -84,12 +94,12 @@ function whichHeader() {
}
add_action( 'wp_enqueue_scripts', 'largo_header_js' );

/**
* Additional scripts to load in the footer (mostly for various social widgets)
*
* @since 1.0
*/
if ( ! function_exists( 'largo_footer_js' ) ) {
/**
* Additional scripts to load in the footer (mostly for various social widgets)
*
* @since 1.0
*/
function largo_footer_js() {

if ( largo_facebook_widget::is_rendered() || largo_follow_widget::is_rendered() ) { ?>
Expand Down Expand Up @@ -177,12 +187,12 @@ function largo_footer_js() {
}
add_action( 'wp_footer', 'largo_footer_js' );

/**
* Add Google Analytics code to the footer, you need to add your GA ID to the theme settings for this to work
*
* @since 1.0
*/
if ( ! function_exists( 'largo_google_analytics' ) ) {
/**
* Add Google Analytics code to the footer, you need to add your GA ID to the theme settings for this to work
*
* @since 1.0
*/
function largo_google_analytics() {
if ( !current_user_can('edit_posts') ) : // don't track editors ?>
<script>
Expand Down
113 changes: 44 additions & 69 deletions options.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,38 +136,6 @@ function optionsframework_options() {
'class' => 'hidden',
'type' => 'text');

$options[] = array(
'name' => __('Menu Options', 'largo'),
'desc' => __('<strong>Show</strong> the "Don\'t Miss" menu under the main site navigation. Add links to this menu under <strong>Appearance > Menus</strong>.', 'largo'),
'id' => 'show_dont_miss_menu',
'type' => 'checkbox');

$options[] = array(
'desc' => __('Enter the <strong>label that appears in front of the menu links in the "Don\'t Miss" menu</strong>. You can delete this default and no label will appear.', 'largo'),
'id' => 'dont_miss_label',
'std' => __('Don\'t Miss', 'largo'),
'class' => 'hidden',
'type' => 'text');

$options[] = array(
'desc' => __('Enter the <strong>label that appears before the menu links in the Footer Nav Menu</strong>. You can delete this default and no label will appear.', 'largo'),
'id' => 'footer_menu_label',
'std' => get_bloginfo('name'),
'type' => 'text');

$options[] = array(
'desc' => __('Show the <strong>sticky nav</strong>? Default is to show, but in some cases you may want to hide it.'),
'id' => 'show_sticky_nav',
'std' => '1',
'type' => 'checkbox');

$options[] = array(
'desc' => __('Show the <strong>site name in the sticky nav</strong>? Default is to show, but in some cases you might want to hide it to save space or if your logo is clear enough to not need it.', 'largo'),
'id' => 'show_sitename_in_sticky_nav',
'std' => '1',
'class' => 'hidden',
'type' => 'checkbox');

$options[] = array(
'name' => __('Copyright Message', 'largo'),
'desc' => __('Enter the <strong>copyright and credit information</strong> to display in the footer. You can use <code>%d</code> to output the current year.', 'largo'),
Expand Down Expand Up @@ -262,51 +230,24 @@ function optionsframework_options() {
'type' => 'info');

$options[] = array(
'desc' => __('<strong>Would you like to display share icons at the top of single posts?</strong> By default social icons appear at the top of single posts but you can choose to not show them at all.', 'largo'),
'desc' => __('<p><strong>Would you like to display share icons at the top of single posts?</strong></p> <p>By default social icons appear at the top of single posts but you can choose to not show them at all.</p>', 'largo'),
'id' => 'single_social_icons',
'std' => '1',
'type' => 'checkbox',);

$options[] = array(
'desc' => __('<strong>Would you like to display share icons in a floating bar beside posts using the single-column post template?</strong>', 'largo'),
'id' => 'single_floating_social_icons',
'std' => '1',
'type' => 'checkbox',);

$options[] = array(
'desc' => __('Select the <strong>share icons</strong> to display at the top of single posts.', 'largo'),
'id' => 'article_utilities',
'std' => $article_utility_buttons_defaults,
'type' => 'multicheck',
'options' => $article_utility_buttons);

/**
* Whether social icons should be shown in the sticky footer.
*
* 1 - show social icons in sticky footer.
* 0 - do not show social icons in the sticky footer.
*
* @since 0.5
*/
$options[] = array(
'desc' => __('<strong>Would you like to display share icons in the footer of single posts?</strong> By default social icons appear in the sticky footer of single posts but you can choose to not show them at all.', 'largo'),
'id' => 'single_social_icons_footer',
'desc' => __('<strong>Would you like to display share icons in a floating bar beside posts using the single-column post template?</strong>', 'largo'),
'id' => 'single_floating_social_icons',
'std' => '1',
'type' => 'checkbox',);

/**
* Which social icons should be shown in the sticky footer.
*
* defaults: $footer_utility_buttons_defaults - facebook, twitter and email.
* @since 0.5
*/
$options[] = array(
'desc' => __('Select the <strong>share icons</strong> to display in the single post sticky footer.', 'largo'),
'id' => 'footer_utilities',
'std' => $footer_utility_buttons_defaults,
'type' => 'multicheck',
'options' => $footer_utility_buttons);

$options[] = array(
'desc' => __('<strong>Use "like" or "recommend"</strong> for Facebook buttons?', 'largo'),
'id' => 'fb_verb',
Expand Down Expand Up @@ -372,7 +313,7 @@ function optionsframework_options() {
* Layout Options
*/
$options[] = array(
'name' => __('Layout Options', 'largo'),
'name' => __('Layout', 'largo'),
'type' => 'heading');

if (count($home_templates)) {
Expand Down Expand Up @@ -481,12 +422,6 @@ function optionsframework_options() {
'std' => '0',
'type' => 'checkbox');

$widget_options[] = $options[] = array(
'desc' => __('Check this box if you want to fade the sidebar out on single story pages as a reader scrolls.', 'largo'),
'id' => 'showey_hidey',
'std' => '0',
'type' => 'checkbox');

$widget_options[] = $options[] = array(
'desc' => __('Enter names of <strong>additional sidebar regions</strong> (one per line) you\'d like post authors to be able to choose to display on their posts.', 'largo'),
'id' => 'custom_sidebars',
Expand All @@ -510,6 +445,46 @@ function optionsframework_options() {

);

/*
* Navigation
*/

$options[] = array(
'name' => __('Navigation', 'largo'),
'type' => 'heading');

$options[] = array(
'name' => __('Menu Options', 'largo'),
'desc' => __('<strong>Show</strong> the "Don\'t Miss" menu under the main site navigation. Add links to this menu under <strong>Appearance > Menus</strong>.', 'largo'),
'id' => 'show_dont_miss_menu',
'type' => 'checkbox');

$options[] = array(
'desc' => __('Enter the <strong>label that appears in front of the menu links in the "Don\'t Miss" menu</strong>. You can delete this default and no label will appear.', 'largo'),
'id' => 'dont_miss_label',
'std' => __('Don\'t Miss', 'largo'),
'class' => 'hidden',
'type' => 'text');

$options[] = array(
'desc' => __('Enter the <strong>label that appears before the menu links in the Footer Nav Menu</strong>. You can delete this default and no label will appear.', 'largo'),
'id' => 'footer_menu_label',
'std' => get_bloginfo('name'),
'type' => 'text');

$options[] = array(
'desc' => __('Show the <strong>sticky nav</strong>? Default is to show, but in some cases you may want to hide it.'),
'id' => 'show_sticky_nav',
'std' => '1',
'type' => 'checkbox');

$options[] = array(
'desc' => __('Show the <strong>site name in the sticky nav</strong>? Default is to show, but in some cases you might want to hide it to save space or if your logo is clear enough to not need it.', 'largo'),
'id' => 'show_sitename_in_sticky_nav',
'std' => '1',
'class' => 'hidden',
'type' => 'checkbox');

/*
* Advanced
*/
Expand Down
3 changes: 1 addition & 2 deletions sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
if ((is_single() || is_singular()) && !largo_is_sidebar_required())
return;

$showey_hidey_class = (of_get_option('showey-hidey'))? 'showey-hidey':'';
$span_class = largo_sidebar_span_class();

do_action('largo_before_sidebar'); ?>
<aside id="sidebar" class="<?php echo $span_class; ?> nocontent">
<?php do_action('largo_before_sidebar_content'); ?>
<div class="widget-area <?php echo $showey_hidey_class ?>" role="complementary">
<div class="widget-area" role="complementary">
<?php
do_action('largo_before_sidebar_widgets');

Expand Down

0 comments on commit cca5b9f

Please sign in to comment.