Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * page.php
- * @package WordPress
- * @subpackage DyneDrewett
- */
- $page_atts = get_page_atts();
- $post_atts = get_post_atts($page_atts);
- get_header();
- ?>
- <div id="content-container">
- <div class="content-left">
- <!-- Page loop -->
- <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
- <h1><?php the_title(); ?></h1>
- <div>
- <?php the_content(); ?>
- </div>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php if($page_atts['include_separator']) : ?>
- <div class="separator solid"></div>
- <?php endif; ?>
- <!-- Post loop -->
- <?php if($page_atts['show_post_loop']) : ?>
- <?php query_posts($post_atts); ?>
- <?php get_template_part('loop', 'index'); ?>
- <?php wp_reset_query(); ?>
- <?php endif; ?>
- </div>
- <?php get_sidebar(); ?>
- </div>
- <?php get_footer(); ?>
- <?php
- function get_page_atts(){
- global $post;
- $post_id = $post->ID;
- switch($post_id) :
- /** Partnerships and Careers */
- case 716 : // Partnerships
- case 162 : // Careers
- $atts['include_separator'] = true;
- $atts['show_post_loop'] = true;
- break;
- default :
- $atts['include_separator'] = false;
- $atts['show_post_loop'] = false;
- endswitch;
- return $atts;
- }
- function get_post_atts($page_atts){
- global $post;
- /** Check to see if we actully need to get the Post attributes */
- if(!$page_atts['show_post_loop']) :
- return false;
- endif;
- $post_id = $post->ID;
- $atts = array(
- 'orderby' => 'date',
- 'order' => ASC,
- 'paged' => get_query_var('paged'),
- 'posts_per_page' => 5,
- 'post_status' => 'publish',
- 'post_type' => POST_TYPE_NEWS
- );
- switch($post_id) :
- /** Partnerships */
- case 716 :
- $atts['orderby'] = 'name';
- $atts['post_type'] = POST_TYPE_PARTNERSHIP;
- break;
- /** Careers */
- case 162 :
- $atts['orderby'] = 'name';
- $atts['post_type'] = POST_TYPE_CAREERXXX;
- break;
- endswitch;
- return $atts;
- }
- ?>
- <?php
- /**
- * loop.php
- * @package WordPress
- * @subpackage DyneDrewett
- */
- ?>
- <?php $post_count = 1; ?>
- <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <!-- Post image -->
- <?php if(get_post_image()) : ?>
- <div class="post_image">
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute('before=View post - '); ?>" class="linked_img">
- <?php post_image(); ?>
- </a>
- </div>
- <?php endif; ?>
- <div class="post_text">
- <!-- Post Title -->
- <div class="post_title">
- <h2 class="alt-link"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute('before=View post - '); ?>">
- <?php the_title(); ?>
- </a></h2>
- </div>
- <!-- Post excerpt -->
- <div class="post_content">
- <?php the_excerpt(); ?>
- </div>
- </div>
- <div class="clear"></div>
- </div>
- <?php article_seperator($post_count) ?>
- <?php $post_count++; ?>
- <?php endwhile; ?>
- <?php if(function_exists('show_page_numbers')) : show_page_numbers(); endif; ?>
- <?php else : ?>
- <?php if(is_page(162)) : // Careers ?>
- <div class="no-posts-found">
- <!-- Post content -->
- <div class="post_content">
- <p>Sorry, Dyne Drewett are not currently recruiting.</p>
- <p>Please check back regularly to be the first to know about any oppurtunities.</p>
- </div>
- </div>
- <?php elseif(is_search()) : ?>
- <div class="no-posts-found">
- <!-- Post Title -->
- <div class="post_title">
- <h2>No results found</h2>
- </div>
- <!-- Post content -->
- <div class="post_content">
- <p>Sorry, we couldn't find any matching posts.</p>
- <p>Please try changing your search parameters and try again.</p>
- </div>
- </div>
- <?php endif; ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement