windhamdavid 5 years ago
parent
commit
25c1c94460
5 changed files with 191 additions and 0 deletions
  1. 81 0
      functions.php
  2. 32 0
      page-history.php
  3. 29 0
      page-press.php
  4. 14 0
      page.php
  5. 35 0
      search.php

+ 81 - 0
functions.php

@@ -0,0 +1,81 @@
+<?php
+
+if ( ! function_exists( '_ph_setup' ) ):
+function _ph_setup() {
+	require( get_template_directory() . '/inc/films-cpt.php' );
+	require( get_template_directory() . '/inc/template-tags.php' );
+	require( get_template_directory() . '/inc/multi-thumbs.php' );
+	require( get_template_directory() . '/inc/tweaks.php' );
+	add_theme_support( 'automatic-feed-links' );
+	register_nav_menus( array( 'primary' => __( 'Primary Menu', '_ph' ), ) );	
+	add_theme_support( 'post-formats', array( 'aside', ) );	
+}
+endif; 
+add_action( 'after_setup_theme', '_ph_setup' );
+
+add_action( 'wp_enqueue_scripts', '_ph_scripts' );
+function _ph_scripts() {
+	global $post;
+	wp_enqueue_style( 'style', get_stylesheet_uri() );
+	wp_enqueue_style( 'style-2', get_template_directory_uri() . '/css/responsive.css');
+	//wp_enqueue_script( 'jquery' );
+	//wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', 'jquery', '20120206', true );
+	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
+		// wp_enqueue_script( 'comment-reply' );
+	}
+	if ( is_singular() && wp_attachment_is_image( $post->ID ) ) {
+		// wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
+	}
+}
+
+
+
+add_filter('show_admin_bar', '__return_false');
+
+add_post_type_support('page', 'excerpt');
+
+add_theme_support( 'post-thumbnails' );
+set_post_thumbnail_size( 600, 360, true );
+add_image_size( 'slide', 600, 300, true );
+add_image_size( 'film', 600, 400 );
+add_image_size( 'cover', 250, 500 );
+add_image_size( 'spotlight', 300, 640, true );
+add_image_size( 'press', 200, 100, true );
+add_image_size( 'small', 75, 75, true );
+add_image_size( 'medium', 800, 600, true );
+add_image_size( 'large', 1200, 800, true );
+
+function ph_thumbs() {
+    global $post;
+    $post = get_post($post);
+	$images =& get_children( 'post_type=attachment&post_mime_type=image&output=ARRAY_N&order=ASC&post_parent='.$post->ID);
+	if($images){
+	foreach( $images as $imageID => $imagePost ){
+	unset($the_ph_img);
+	$the_ph_img = wp_get_attachment_image($imageID, 'small', false);
+	$thumblist = '<a class="film-link" href="'.get_attachment_link($imageID).'">'.$the_ph_img.'</a>';
+	
+	}
+  }
+return $thumblist;
+}
+function tinymce_excerpt_js(){ ?>
+<script type="text/javascript">
+        jQuery(document).ready( tinymce_excerpt );
+            function tinymce_excerpt() {
+                jQuery("#excerpt").addClass("mceEditor");
+                tinyMCE.execCommand("mceAddControl", false, "excerpt");
+            }
+</script>
+<?php }
+add_action( 'admin_head-post.php', 'tinymce_excerpt_js');
+add_action( 'admin_head-post-new.php', 'tinymce_excerpt_js');
+function tinymce_css(){ ?>
+<style type='text/css'>
+            #postexcerpt .inside{margin:0;padding:0;background:#fff;}
+            #postexcerpt .inside p{padding:0px 0px 5px 10px;}
+            #postexcerpt #excerpteditorcontainer { border-style: solid; padding: 0; }
+</style>
+<?php }
+add_action( 'admin_head-post.php', 'tinymce_css');
+add_action( 'admin_head-post-new.php', 'tinymce_css');

+ 32 - 0
page-history.php

@@ -0,0 +1,32 @@
+<?php /* Template Name: History*/ ?>
+<?php get_header(); ?>
+<div id="press-wrap">
+<div class="container">
+	<div class="row">
+		<div class="history">
+			<?php if ( have_posts() ) : ?>
+			<?php while ( have_posts() ) : the_post(); ?>
+		<div class="sixcol">
+			<header class="entry-header">
+				<h1><?php the_title(); ?></h1>
+			</header>
+				<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
+					<div style="float:left;margin: 0 20px 20px 0;max-width:100%;">
+					<?php the_post_thumbnail('large');?>
+					</div>
+					<?php the_excerpt(); ?>
+				</article>
+			<?php endwhile; endif;?>
+		</div>
+		<div class="sixcol">
+			<article>
+			<div class="top-pad page">
+				<?php the_content(); ?>
+			</div>
+			</article>
+		</div>
+	</div>
+	</div>
+</div>
+</div>
+<?php get_footer(); ?>

+ 29 - 0
page-press.php

@@ -0,0 +1,29 @@
+<?php /* Template Name: Press */ ?>
+<?php get_header(); ?>
+<div id="press-wrap">
+<div class="container">
+	<div class="row journal">
+		<div class="twelvecol">
+			<?php query_posts( array ( 'paged' => get_query_var('paged') ) ); ?>
+			<?php if ( have_posts() ) : ?>
+			<?php while ( have_posts() ) : the_post(); ?>
+				<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
+					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
+					<time datetime="<?php the_time('Y-m-d')?>"><?php the_time('F jS, Y') ?></time>
+					<?php the_content(); ?>
+					<?php the_tags('Tags: ', ', ', '<br />'); ?> 
+				</article>
+			<?php endwhile; endif;?>			
+			<div class="page-navigation">
+				<div class="next">
+	       		 	<?php previous_posts_link('More Recent') ?> 	
+				</div>
+				<div class="previous">	   
+					<?php next_posts_link('Older') ?>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+</div>
+<?php get_footer(); ?>

+ 14 - 0
page.php

@@ -0,0 +1,14 @@
+<?php get_header(); ?>
+
+	<div class="container">
+		<div class="row">
+			<div class="twelvecol">
+				<?php while ( have_posts() ) : the_post(); ?>
+					<?php get_template_part( 'content', 'page' ); ?>
+					<?php comments_template( '', true ); ?>
+				<?php endwhile; ?>
+			</div>
+		</div>
+	</div>
+
+<?php get_footer(); ?>

+ 35 - 0
search.php

@@ -0,0 +1,35 @@
+<?php get_header(); ?>
+	<div class="container search-results">
+		<div class="row">
+			<div class="twocol">
+			&nbsp;
+			</div>
+			<div class="eightcol">
+			<?php if ( have_posts() ) : ?>
+				<header class="page-header">
+					<h1 class="page-title"><?php printf( __( 'Search Results for: %s', '_ph' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
+				</header>
+				<?php while ( have_posts() ) : the_post(); ?>
+					<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', '_ph' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
+					<div class="entry-meta">
+						<?php _ph_posted_on(); ?>
+					</div>
+				<?php the_excerpt(); ?>
+				<?php endwhile; ?>
+				<?php else : ?>
+				<article id="post-0" class="post no-results not-found">
+					<header class="entry-header">
+						<h1 class="entry-title"><?php _e( 'Nothing Found', '_ph' ); ?></h1>
+					</header>
+					<div class="entry-content">
+						<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', '_ph' ); ?></p>
+					</div>
+				</article>
+				<?php endif; ?>
+			</div>
+			<div class="twocol">
+			&nbsp;
+			</div>
+		</div>
+	</div>
+<?php get_footer(); ?>