Browse Source

backbone blog

windhamdavid 5 years ago
parent
commit
ce9148e037
8 changed files with 67 additions and 44 deletions
  1. 5 1
      functions.php
  2. 2 8
      header.php
  3. 3 14
      index.php
  4. 0 0
      js/wp-api.js
  5. 0 20
      page-blog.php
  6. 28 0
      page-notebook.php
  7. 28 0
      style.css
  8. 1 1
      underscore.php

+ 5 - 1
functions.php

@@ -29,10 +29,14 @@ function dw_scripts() {
 	wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', 'jquery', '', true );
 	wp_enqueue_script( 'script', get_template_directory_uri() . '/js/script.js', 'jquery', '', true );
 	wp_enqueue_script( 'init', get_template_directory_uri() . '/js/init.js', 'jquery', '', true );
+	//wp_enqueue_script( 'api', get_template_directory_uri() . '/js/wp-api.js', 'jquery', '', true );
+	
+	//wp_register_script( 'wp-api', get_template_directory_uri() . '/js/wp-api.js', array( 'jquery', 'backbone', 'underscore' ), '1.1', true );
 
 	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
 		wp_enqueue_script( 'comment-reply' );
-	} elseif ( is_home() || is_front_page() || is_archive() || is_search() ) {
+	} elseif ( is_page('notebook') || is_front_page() || is_archive() || is_search() ) {
+		
 		global $wp_rewrite;
 
 		wp_enqueue_script( '_s_backbone-loop', get_template_directory_uri() . '/js/loop.js', array( 'jquery', 'backbone', 'underscore', 'wp-api'  ), '1.0', true );

+ 2 - 8
header.php

@@ -16,22 +16,16 @@
 </head>
 <body>
 <header id="header">
-		
 	<div class="navbar navbar-fixed-top" role="navigation">
 		<div class="container">
-		<div class="container site-title">
+		<div class="site-title">
 			<a href="http://davidawindham.com" title="David Windham"><img class="dw" title="David Windham" src="<?php echo get_bloginfo('template_directory');?>/img/dw.png" width="17"/></a>
 			<a href="<?php echo home_url( '/' ); ?>" class="navbar-brand navbar-right" title="David A. Windham" rel="home">David A. Windham</a>			
 		</div>
 		</div>
 		<a href="#" class="nav-toggle navbar-right" data-toggle="offcanvas" data-target=".navmenu" data-canvas="body"><span></span></a>
-	
 	</div>
 </header>
 <nav class="navmenu navmenu-default navmenu-fixed-right offcanvas" role="complementary">
-	<ul class="nav bs-docs-sidenav">
-		<li><a href="bio">bio</a></li>
-		<li><a href="archive">archives</a></li>
-		<li><a href="contact">contact</a></li>
-	</ul>
+	<?php wp_nav_menu( array( 'menu' => 'main','sort_column' => 'menu_order', 'container_class' => 'nav-stacked', 'menu_class' => 'nav nav-stacked' ) ); ?>
 </nav>

+ 3 - 14
index.php

@@ -1,20 +1,9 @@
 <?php get_header(); ?>
-<?php get_template_part( 'underscore' ); ?>
 	<div class="container">
 		<div id="content" role="main">
-			<?php if ( have_posts() ) : ?>
-
-				<?php while ( have_posts() ) : the_post(); ?>
-
-					<?php get_template_part( 'content' ); ?>
-
-				<?php endwhile; ?>
-
-			<?php else : ?>
-
-				<?php get_template_part( 'content', 'none' ); ?>
-
-			<?php endif; ?>
+			<main id="main" class="site-main" role="main">
+				<!-- Not sure what I'm going to have on my main page just yet -->
+			</div>
 		</div>
 	</div>
 <?php get_footer(); ?>

js/wp-api.min.js → js/wp-api.js


+ 0 - 20
page-blog.php

@@ -1,20 +0,0 @@
-<?php get_header(); ?>
-<?php get_template_part( 'underscore' ); ?>
-	<div class="container">
-		<div id="content" role="main">
-			<?php if ( have_posts() ) : ?>
-
-				<?php while ( have_posts() ) : the_post(); ?>
-
-					<?php get_template_part( 'content' ); ?>
-
-				<?php endwhile; ?>
-
-			<?php else : ?>
-
-				<?php get_template_part( 'content', 'none' ); ?>
-
-			<?php endif; ?>
-		</div>
-	</div>
-<?php get_footer(); ?>

+ 28 - 0
page-notebook.php

@@ -0,0 +1,28 @@
+<?php
+/*
+Template Name: Notebook
+*/
+
+get_header(); ?>
+<?php get_template_part( 'underscore' ); ?>
+	<div class="container">
+		<div id="content" role="main">
+			<main id="main" class="site-main" role="main">
+			<?php query_posts('showposts=10'); ?>
+			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+			<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+				<div class="entry-content">
+					<div class="date">
+						<?php the_date('M j, Y'); ?>		
+					</div>
+					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+					<?php the_content(); ?>
+					<?php comments_template( '', true ); ?>
+					<div class="clear">&nbsp;</div>
+				</div>
+			</div>
+			<?php endwhile; ?>
+			</div>
+		</div>
+	</div>
+<?php get_footer(); ?>

+ 28 - 0
style.css

@@ -99,6 +99,34 @@ body,input,textarea {color: #666;font-size: 12px;line-height: 18px;}
 }
 
 
+.slate:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; }
+
+.clearfix:before,
+.clearfix:after,
+.row:before,
+.row:after {
+  content: '\0020';
+  display: block;
+  overflow: hidden;
+  visibility: hidden;
+  width: 0;
+  height: 0; }
+.row:after,
+.clearfix:after {
+  clear: both; }
+.row,
+.clearfix {
+  zoom: 1; }
+
+.clear {
+  clear: both;
+  display: block;
+  overflow: hidden;
+  visibility: hidden;
+  width: 0;
+  height: 0;
+}
+
 /*====== Type ======*/
 
 body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;font-size: 14px;line-height: 1.42857143;}

+ 1 - 1
underscore.php

@@ -56,7 +56,7 @@
 <script type="text/html" id="more-button-template">
 	<div class="more-posts">
 
-		<a class="more-button button" href="#"><?php esc_html_e( 'More', '_s_backbone' ); ?></a>
+		<a class="more-button button btn-lg btn btn-danger" href="#"><?php esc_html_e( 'More', '_s_backbone' ); ?></a>
 
 	</div>
 </script>