Permalink
Browse files

Use 'templates' for dev and support pages. Begin structure of blog.

  • Loading branch information...
1 parent b26c84a commit 71fa370dd2629f7dd342fe749c75d80a52a3a6ff @tomneedham tomneedham committed Feb 25, 2012
Showing with 173 additions and 59 deletions.
  1. +62 −0 blog.php
  2. +0 −23 content-page.php
  3. +13 −2 content.php
  4. +21 −12 dev.php
  5. +7 −0 functions.php
  6. +26 −10 index.php
  7. +16 −0 notitle.php
  8. +1 −0 single.php
  9. +3 −0 style.css
  10. +24 −12 support.php
View
@@ -0,0 +1,62 @@
+<?php
+/*
+Template Name: Blog
+*/
+?>
+
+<?php
+get_header();
+
+<?php
+$temp = $wp_query;
+$wp_query= null;
+$wp_query = new WP_Query();
+$wp_query->query('posts_per_page=1'.'&paged='.$paged);
+while ($wp_query->have_posts()) : $wp_query->the_post();
+?>
+
+ get_template_part( 'content', get_post_format() );
+ endwhile;
+ get_footer();
+<?php $wp_query = null; $wp_query = $temp;?>
+
+?>
+
+
+
+<?php /* get_header(); ?>
+
+<div class="page-header"><a href="/support/"><h1>Development Blog</h1></a>
+ <form role="search" method="get" class="headersearch" id="searchform" action="<?php echo home_url( '/' ); ?>">
+ <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
+ <input type="submit" id="searchsubmit" class="btn" value="Search" />
+ </form>
+</div>
+
+<div class="row">
+
+<?php if (have_posts()) : while (have_posts()) : the_post();?>
+
+ <div class="span12">
+ <h1><?php the_title();?></h1>
+ <hr class="pagetitle">
+ <div class="page-content">
+ <?php the_content(); ?>
+ </div>
+ </div>
+<?php endwhile; endif; ?>
+
+ <div class="span4">
+ <div class="sidebar">
+ <div class="well">
+ <?php
+ dynamic_sidebar('blog');
+ ?>
+ </div>
+ </div>
+ </div>
+
+</div>
+
+<?php get_footer(); */?>
+
View
@@ -1,23 +0,0 @@
-<?php
-// Check if id Dev page or has the Dev ancestor
-$dev = has_ancestor('Dev',$post->ID);
-$support = has_ancestor('Support',$post->ID);
-if(is_page('Dev') || $dev)
-{
- get_template_part('dev');
-}
-elseif(is_page('Support') || $support)
-{
- get_template_part('support');
-}
-else
-{
- the_content();
-}
-if(is_front_page()){
- // Show the widget footer
- echo '<hr><div class="row">';
- dynamic_sidebar('Home Footer');
- echo '</div>';
-}
-?>
View
@@ -1,2 +1,13 @@
-<div class="page-header"><h1><?php the_title(); ?></h1></div>
-<?php the_content(); ?>
+<div class="row">
+ <div class="span12 post-header">
+ <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
+ <small><?php the_date(); ?></small>
+ </div>
+</div>
+<div class="row">
+ <div class="span12 post">
+ <?php the_content(); ?>
+ <hr />
+ </div>
+</div>
+
View
33 dev.php
@@ -1,9 +1,18 @@
+<?php
+/*
+Template Name: Developer Centre
+*/
+?>
+
+<?php get_header(); ?>
+
<div class="page-header"><a href="/dev/"><h1>Developer Centre</h1></a>
<form role="search" method="get" class="headersearch" id="searchform" action="<?php echo home_url( '/' ); ?>">
<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" class="btn" value="Search" />
</form>
</div>
+
<div class="row">
<div class="span4">
<div class="sidebar">
@@ -14,18 +23,18 @@
</div>
</div>
</div>
+
+<?php if (have_posts()) : while (have_posts()) : the_post();?>
+
<div class="span12">
- <?php
- if(!is_page('Dev')){
- ?>
- <h1>
- <?php the_title(); ?>
- </h1>
- <hr class="pagetitle">
- <div class="page-content">
- <?php
- }
- the_content();
- ?>
+ <h1><?php the_title();?></h1>
+ <hr class="pagetitle">
+ <div class="page-content">
+ <?php the_content(); ?>
+ </div>
+<?php endwhile; endif; ?>
+
</div>
</div>
+
+<?php get_footer(); ?>
View
@@ -174,4 +174,11 @@ function datetoarr($d) {
);
}
+// https://gist.github.com/1189639
+function is_blog () {
+ global $post;
+ $posttype = get_post_type($post );
+ return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
+}
+
?>
View
@@ -1,11 +1,27 @@
<?php
-get_header();
-
-if ( have_posts() ) :
- while ( have_posts() ) : the_post();
- get_template_part( 'content', get_post_format() );
- endwhile;
-else :
- get_footer();
-endif;
-?>
+get_header();
+
+if( is_blog() ){ ?>
+<div class="page-header">
+ <h1>Development Blog</h1>
+</div>
+<?php
+}
+?>
+<?php
+$temp = $wp_query;
+$wp_query= null;
+$wp_query = new WP_Query();
+$wp_query->query('posts_per_page=5'.'&paged='.$paged);
+while ($wp_query->have_posts()) : $wp_query->the_post();
+?>
+
+
+ <?php get_template_part( 'content', get_post_format() ); ?>
+
+ <?php endwhile; ?>
+<?php $wp_query = null; $wp_query = $temp;?>
+
+
+
+<?php get_footer(); ?>
View
@@ -0,0 +1,16 @@
+<?php
+/*
+Template Name: No Title
+*/
+?>
+
+<?php get_header(); ?>
+
+<?php if (have_posts()) : while (have_posts()) : the_post();?>
+
+<?php the_content(); ?>
+
+<?php endwhile; endif; ?>
+
+<?php get_footer(); ?>
+
View
@@ -7,6 +7,7 @@
<h1><?php the_title(); ?> <small><?php the_date(); ?></small></h1>
</a>
</div>
+<a href="/blog/"><- Back to blog</a>
<?php
the_content();
endwhile; // end of the loop.
View
@@ -523,4 +523,7 @@ ul.menu{
#downloadbtn{
margin-top: -3px;
margin-right: -7px;
+}
+.post {
+ margin-top: 8px;
}
View
@@ -1,9 +1,19 @@
+<?php
+/*
+Template Name: Support Centre
+*/
+?>
+
+<?php get_header(); ?>
+
<div class="page-header"><a href="/support/"><h1>Support Centre</h1></a>
<form role="search" method="get" class="headersearch" id="searchform" action="<?php echo home_url( '/' ); ?>">
<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" class="btn" value="Search" />
</form>
-</div><div class="row">
+</div>
+
+<div class="row">
<div class="span4">
<div class="sidebar">
<div class="well">
@@ -13,17 +23,19 @@
</div>
</div>
</div>
+
+<?php if (have_posts()) : while (have_posts()) : the_post();?>
+
<div class="span12">
- <?php
- if(!is_page('Support')){
- ?>
- <h1>
- <?php the_title(); ?>
- </h1>
- <hr class="pagetitle">
- <?php
- }
- the_content();
- ?>
+ <h1><?php the_title();?></h1>
+ <hr class="pagetitle">
+ <div class="page-content">
+ <?php the_content(); ?>
+ </div>
+<?php endwhile; endif; ?>
+
</div>
</div>
+
+<?php get_footer(); ?>
+

0 comments on commit 71fa370

Please sign in to comment.