Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Orphaned H1 closing tag #48

Merged
merged 3 commits into from Apr 28, 2012
View
@@ -8,6 +8,7 @@
*
* Last Revised: January 22, 2012
*/
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<div class="row">
<div class="container">
@@ -25,6 +26,7 @@
</header>
<div class="row content">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar(); ?>
<div class="span8">
@@ -49,6 +51,7 @@
</div><!--/.span4 -->
</div><!--/.row -->
</div><!--/.span8 -->
- <?php get_sidebar(); ?>
+ <?php if($options['sidebar_pos'] != 'left') get_sidebar(); ?>
+</div><!-- /.row .content -->
<?php get_footer(); ?>
View
@@ -11,7 +11,7 @@
* @subpackage WP-Bootstrap
* @since WP-Bootstrap 0.6
*/
-
+$options = get_option( 'bootstrapwp_theme_options' );
get_header();
if (have_posts() ) ;?>
<div class="row">
@@ -44,10 +44,10 @@
_e( 'Blog Archives', 'bootstrapwp' );
}
?></h1>
- </h1>
</header>
<div class="row content">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar('blog'); ?>
<div class="span8">
<?php while ( have_posts() ) : the_post(); ?>
<div <?php post_class(); ?>>
@@ -69,6 +69,7 @@
<?php bootstrapwp_content_nav('nav-below');?>
</div><!-- /.span8 -->
- <?php get_sidebar('blog'); ?>
+ <?php if($options['sidebar_pos'] != 'left') get_sidebar('blog'); ?>
+</div><!-- /.row .content -->
<?php get_footer(); ?>
View
@@ -6,7 +6,7 @@
* @subpackage WP-Bootstrap
* @since WP-Bootstrap 0.1
*/
-
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<?php if ( have_posts() ) : ?>
@@ -37,6 +37,7 @@
rewind_posts();
?>
<div class="row content">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar('blog'); ?>
<div class="span8">
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
@@ -58,6 +59,7 @@
<?php endwhile; ?>
<?php endif; ?>
</div><!-- /.span8 -->
- <?php get_sidebar('blog'); ?>
+ <?php if($options['sidebar_pos'] != 'left') get_sidebar('blog'); ?>
+ </div><!-- /.row .content -->
<?php get_footer(); ?>
View
@@ -13,6 +13,11 @@
*
* Last Updated: April 11, 2012
*/
+
+ /**
+ * Declaring the theme options
+ */
+require_once ( get_stylesheet_directory() . '/theme-options.php' );
/**
* Declaring the content width based on the theme's design and stylesheet.
View
@@ -10,6 +10,7 @@
*
* Last Revised: March 4, 2012
*/
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<div class="container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
View
@@ -7,7 +7,7 @@
* @subpackage WP-Bootstrap
* @since WP-Bootstrap 0.1
*/
-
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="row">
@@ -23,6 +23,7 @@
</header>
<div class="row content">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar('blog'); ?>
<div class="span8">
<?php the_content();
endwhile;
@@ -58,5 +59,6 @@
<?php bootstrapwp_content_nav('nav-below');?>
</div><!-- /.span8 -->
-<?php get_sidebar('blog'); ?>
+<?php if($options['sidebar_pos'] != 'left') get_sidebar('blog'); ?>
+</div><!-- /.row .content -->
<?php get_footer(); ?>
View
@@ -7,7 +7,7 @@
* @subpackage WP-Bootstrap
* @since WP-Bootstrap 0.1
*/
-
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="row">
View
@@ -9,7 +9,7 @@
* @subpackage WP-Bootstrap
* @since WP-Bootstrap 0.1
*/
-
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="row">
@@ -27,13 +27,14 @@
</header>
<div class="row content">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar(); ?>
<div class="span8">
<?php the_content();?>
<?php endwhile; // end of the loop. ?>
</div><!-- /.span8 -->
- <?php get_sidebar(); ?>
-
+ <?php if($options['sidebar_pos'] != 'left') get_sidebar(); ?>
+ </div><!-- /.row .content -->
<?php get_footer(); ?>
View
@@ -10,6 +10,7 @@
*
* Last Revised: January 22, 2012
*/
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<div class="container">
<?php if ( have_posts() ) : ?>
@@ -21,6 +22,7 @@
</header>
<div class="row content">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar(); ?>
<div class="span8">
<?php while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><h2> <?php the_title();?></h2></a>
@@ -36,6 +38,7 @@
<p class="lead"><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps you should try again with a different search term.', 'bootstrapwp' ); ?></p>
</header>
<div class="row content">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar(); ?>
<div class="span8">
@@ -50,5 +53,6 @@
</div><!--/.span8 -->
-<?php get_sidebar(); ?>
+<?php if($options['sidebar_pos'] != 'left') get_sidebar(); ?>
+</div><!-- /.row .content -->
<?php get_footer(); ?>
View
@@ -13,6 +13,4 @@
if ( function_exists('dynamic_sidebar')) dynamic_sidebar("sidebar-posts");
?>
</div><!--/.well .sidebar-nav -->
- </div><!-- /.span4 -->
- </div><!-- /.row .content -->
-
+</div><!-- /.span4 -->
View
@@ -13,6 +13,5 @@
if ( function_exists('dynamic_sidebar')) dynamic_sidebar("sidebar-page");
?>
</div><!--/.well .sidebar-nav -->
- </div><!-- /.span4 -->
- </div><!-- /.row .content -->
+</div><!-- /.span4 -->
View
@@ -10,7 +10,7 @@
* @subpackage WP-Bootstrap
* @since WP-Bootstrap 0.1
*/
-
+$options = get_option( 'bootstrapwp_theme_options' );
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="row">
@@ -28,6 +28,7 @@
<div class="row content">
<div class="span8">
+ <?php if($options['sidebar_pos'] == 'left') get_sidebar('blog'); ?>
<p class="meta"><?php echo bootstrapwp_posted_on();?></p>
<?php the_content();?>
<?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
@@ -38,7 +39,7 @@
<?php bootstrapwp_content_nav('nav-below');?>
</div><!-- /.span8 -->
- <?php get_sidebar('blog'); ?>
-
+ <?php if($options['sidebar_pos'] != 'left') get_sidebar('blog'); ?>
+ </div><!-- /.row .content -->
<?php get_footer(); ?>
View
@@ -0,0 +1,95 @@
+<?php
+
+add_action( 'admin_init', 'theme_options_init' );
+add_action( 'admin_menu', 'theme_options_add_page' );
+
+/**
+ * Init plugin options to white list our options
+ */
+function theme_options_init(){
+ register_setting( 'bootstrapwp_options', 'bootstrapwp_theme_options', 'theme_options_validate' );
+}
+
+/**
+ * Load up the menu page
+ */
+function theme_options_add_page() {
+ add_theme_page( __( 'Theme Options', 'bootstrapwp_theme' ), __( 'Theme Options', 'bootstrapwp_theme' ), 'edit_theme_options', 'theme_options', 'theme_options_do_page' );
+}
+
+$sidebar_pos_options = array(
+ 'right' => array(
+ 'value' => 'right',
+ 'label' => __( 'Right', 'bootstrapwp_theme' )
+ ),
+ 'left' => array(
+ 'value' => 'left',
+ 'label' => __( 'Left', 'bootstrapwp_theme' )
+ ),
+);
+
+/**
+ * Create the options page
+ */
+function theme_options_do_page() {
+ global $sidebar_pos_options;
+
+ if ( ! isset( $_REQUEST['settings-updated'] ) )
+ $_REQUEST['settings-updated'] = false;
+
+ $options = get_option( 'bootstrapwp_theme_options' );
+
+ if ( !isset($options['sidebar_pos']) || is_null($options['sidebar_pos']) || $options['sidebar_pos'] == '')
+ $options['sidebar_pos'] = 'right';
+
+ ?>
+ <div class="wrap">
+ <?php screen_icon(); echo "<h2>" . get_current_theme() . __( ' Theme Options', 'bootstrapwp_theme' ) . "</h2>"; ?>
+
+ <?php if ( false !== $_REQUEST['settings-updated'] ) : ?>
+ <div class="updated fade"><p><strong><?php _e( 'Options saved', 'bootstrapwp_theme' ); ?></strong></p></div>
+ <?php endif; ?>
+
+ <form method="post" action="options.php">
+ <?php settings_fields( 'bootstrapwp_options' ); ?>
+ <table class="form-table">
+ <tr valign="top"><th scope="row"><?php _e( 'Show sidebar on left or right', 'bootstrapwp_theme' ); ?></th>
+ <td>
+ <fieldset><legend class="screen-reader-text"><span><?php _e( 'Show sidebar on left or right', 'bootstrapwp_theme' ); ?></span></legend>
+ <?php
+ foreach ( $sidebar_pos_options as $option ) {
+ $checked = ( $options['sidebar_pos'] == $option['value'] ) ? "checked=\"checked\"" : '';
+ ?>
+ <label class="description"><input type="radio" name="bootstrapwp_theme_options[sidebar_pos]" value="<?php esc_attr_e( $option['value'] ); ?>" <?php echo $checked; ?> /> <?php echo $option['label']; ?></label><br />
+ <?php
+ }
+ ?>
+ </fieldset>
+ </td>
+ </tr>
+
+ </table>
+
+ <p class="submit">
+ <input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'bootstrapwp_theme' ); ?>" />
+ </p>
+ </form>
+ </div>
+ <?php
+}
+
+/**
+ * Sanitize and validate input. Accepts an array, return a sanitized array.
+ */
+function theme_options_validate( $input ) {
+ global $sidebar_pos_options;
+
+ // Our radio option must actually be in our array of radio options
+ if ( ! isset( $input['sidebar_pos'] ) )
+ $input['sidebar_pos'] = 'right';
+ if ( ! array_key_exists( $input['sidebar_pos'], $sidebar_pos_options ) )
+ $input['sidebar_pos'] = 'right';
+
+
+ return $input;
+}