Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php get_sidebar(); ?>
- <div id="front">
- <?php if(!is_paged()) { ?>
- <div class="topstory">
- <?php $args = array(
- 'cat' => -5,
- 'post_type' => array('news','post'),
- 'post__in' =>get_option( 'sticky_posts' ),
- 'posts_per_page' => 1,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'posttypes',
- 'terms' => 11,
- 'field' => 'id',
- 'operator' => 'NOT IN',
- )
- )
- );
- query_posts( $args ); ?>
- <?php if( $wp_query->post_count >=2 ) : ?>
- <div class="topcolumn">
- <?php else : ?>
- <div class="toppost">
- <?php endif; ?>
- <?php $saved_ids = array(); while (have_posts()) : the_post(); ?>
- <?php $saved_ids[] = $post->ID; ?>
- <?php $value = get_post_meta($post->ID, 'type', true) ?>
- <?php if($value == 'bigstory') { ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('post-big-story'); ?>>
- <span class="title"><?php if ( get_post_meta($post->ID, 'link', true) ) { ?><a href="<?php echo get_post_meta($post->ID, 'link', true); ?>"><?php the_title(); ?></a><?php } else { ?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a><?php }?></span>
- <?php
- $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
- foreach ( $attachments as $attachment_id => $attachment ) {
- echo wp_get_attachment_image( $attachment_id, 'Front Big Story' );
- } ?>
- <div id="imgcaption"><?php $thumb_id = get_post_thumbnail_id($post->id); $args = array( 'post_type' => 'attachment','post_status' => null,'post_parent' => $post->ID,'include' => $thumb_id);
- $thumb_images = get_posts($args);
- foreach ($thumb_images as $thumb_image) {
- if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
- }
- ?></div>
- <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
- <?php the_excerpt(); ?>
- <ul class="group-items">
- <?php
- $taxonomies = get_post_meta($post->ID, 'groupid', true);
- $myq = new WP_Query('groupitems='.$taxonomies);
- if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
- <li><?php if ( get_post_meta($post->ID, 'livetype', true) ) { ?><span class="source"><?php echo get_post_meta($post->ID, 'livetype', true); ?></span><?php } ?> <a class="link" href="<?php echo( get_post_meta($post->ID, 'link', true) ) ?>"><?php the_title(); ?></a> <span class="source2"><?php echo( get_post_meta($post->ID, 'logo_title', true) ) ?></span></li>
- <?php endwhile; else:?>
- </ul>
- <?php endif;?>
- <?php }?>
- </div>
- <?php } elseif($value == 'breakingnews') { ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('post-breaking-news'); ?>>
- <div id="img">
- <?php
- $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
- foreach ( $attachments as $attachment_id => $attachment ) {
- echo wp_get_attachment_image( $attachment_id, 'Front Big Story' );
- } ?>
- <h2><div id="breakingtitle">Developing:</div></h2>
- </div>
- <span><?php if ( get_post_meta($post->ID, 'link', true) ) { ?><a href="<?php echo get_post_meta($post->ID, 'link', true); ?>"><?php the_title(); ?></a><?php } else { ?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a><?php }?></span></h2>
- <div id="imgcaption"><?php $thumb_id = get_post_thumbnail_id($post->id); $args = array( 'post_type' => 'attachment','post_status' => null,'post_parent' => $post->ID,'include' => $thumb_id);
- $thumb_images = get_posts($args);
- foreach ($thumb_images as $thumb_image) {
- if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
- }
- ?></div>
- <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
- <?php the_excerpt(); ?>
- <ul class="group-items">
- <?php
- $taxonomies = get_post_meta($post->ID, 'groupid', true);
- $myq = new WP_Query('groupitems='.$taxonomies);
- if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
- <li><?php if ( get_post_meta($post->ID, 'livetype', true) ) { ?><span class="source"><?php echo get_post_meta($post->ID, 'livetype', true); ?></span><?php } ?> <a class="link" href="<?php echo( get_post_meta($post->ID, 'link', true) ) ?>"><?php the_title(); ?></a> <span class="source2"><?php echo( get_post_meta($post->ID, 'logo_title', true) ) ?></span></li>
- <?php endwhile; else:?>
- </ul>
- <?php endif;?>
- <?php }?>
- </div>
- <?php } elseif($value == 'groupfront') { ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('post-group'); ?>>
- <div id="img">
- <?php
- $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
- foreach ( $attachments as $attachment_id => $attachment ) {
- echo wp_get_attachment_image( $attachment_id, 'Front Group' );
- } ?>
- <h2><span><?php if ( get_post_meta($post->ID, 'link', true) ) { ?><a href="<?php echo get_post_meta($post->ID, 'link', true); ?>"><?php the_title(); ?></a><?php } else { ?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a><?php }?></span></h2>
- </div>
- <div id="imgcaption"><?php $thumb_id = get_post_thumbnail_id($post->id); $args = array( 'post_type' => 'attachment','post_status' => null,'post_parent' => $post->ID,'include' => $thumb_id);
- $thumb_images = get_posts($args);
- foreach ($thumb_images as $thumb_image) {
- if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
- }
- ?></div>
- <?php the_excerpt(); ?>
- <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
- <ul class="group-items">
- <?php
- $taxonomies = get_post_meta($post->ID, 'groupid', true);
- $myq = new WP_Query('groupitems='.$taxonomies);
- if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
- <li><?php if ( get_post_meta($post->ID, 'livetype', true) ) { ?><span class="source"><?php echo get_post_meta($post->ID, 'livetype', true); ?></span><?php } ?> <a class="link" href="<?php echo( get_post_meta($post->ID, 'link', true) ) ?>"><?php the_title(); ?></a> <span class="source2"><?php echo( get_post_meta($post->ID, 'logo_title', true) ) ?></span></li>
- <?php endwhile; else:?>
- </ul>
- <?php endif;?>
- <?php }?>
- </div>
- <?php } else { ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
- <div id="img">
- <?php
- $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
- foreach ( $attachments as $attachment_id => $attachment ) {
- echo wp_get_attachment_image( $attachment_id, 'Front' );
- } ?>
- </div>
- <h2><span><?php if ( get_post_meta($post->ID, 'link', true) ) { ?><a href="<?php echo get_post_meta($post->ID, 'link', true); ?>"><?php the_title(); ?></a><?php } else { ?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a><?php }?></span></h2>
- <div id="imgcaption"><?php $thumb_id = get_post_thumbnail_id($post->id); $args = array( 'post_type' => 'attachment','post_status' => null,'post_parent' => $post->ID,'include' => $thumb_id);
- $thumb_images = get_posts($args);
- foreach ($thumb_images as $thumb_image) {
- if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
- }
- ?></div>
- <?php
- ob_start();
- the_content('',FALSE,'');
- $old_content = ob_get_clean();
- $new_content = strip_tags($old_content, '<p><a><b><br /><input><form><textarea><li><ol><ul><table>');
- echo $new_content; ?>
- <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
- <ul class="group-items">
- <?php
- $taxonomies = get_post_meta($post->ID, 'groupid', true);
- $myq = new WP_Query('groupitems='.$taxonomies);
- if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
- <li><?php if ( get_post_meta($post->ID, 'livetype', true) ) { ?><span class="source"><?php echo get_post_meta($post->ID, 'livetype', true); ?></span><?php } ?> <a class="link" href="<?php echo( get_post_meta($post->ID, 'link', true) ) ?>"><?php the_title(); ?></a> <span class="source2"><?php echo( get_post_meta($post->ID, 'logo_title', true) ) ?></span></li>
- <?php endwhile; else:?>
- </ul>
- <?php endif;?>
- <?php }?>
- </div>
- <?php } ?>
- <?php?>
- <?php endwhile; ?>
- </div>
- </div>
- <?php } ?>
- <div id="countrydivcontainer">
- <?php wp_reset_query(); ?>
- <?php $count = 1; ?>
- <?php $my_query2 = new WP_Query( array( 'post__not_in' => $saved_ids, 'paged' => get_query_var('paged'), 'post_type' => array( 'news', 'post' ), 'posts_per_page' => 10, 'tax_query' => array( array('taxonomy' => 'posttypes', 'terms' => 11, 'field' => 'id', 'operator' => 'NOT IN')))); ?>
- <?php while ($my_query2->have_posts()) : $my_query2->the_post(); if ($post->ID == $displayed) continue;?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>
- <?php if ( 'news' == get_post_type() ) { ?>
- <div id="img">
- <img src="/img/cnetnews.jpg">
- <h2><span>Partner site:</span></h2>
- </div>
- <div id="right">
- <?php if ( get_post_meta($post->ID, 'link', true) ) { ?><span class="title"><a href="<?php echo get_post_meta($post->ID, 'link', true); ?>"><?php the_title(); ?></a></span><?php } else { ?><span class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span><?php }?>
- <span class="date">Posted: <?php the_time('M j, Y / g:i A') ?> CT</span>
- <?php the_excerpt(); ?>
- </div>
- <?php } elseif ( in_category('7') ) { ?>
- <div id="img">
- <span class="galleryimg"><?php the_post_thumbnail(); ?></span>
- </div>
- <div id="right">
- <span class="title"><a href="<?php the_permalink() ?>">Gallery: <?php the_title(); ?></a></span>
- <div class="metaauthor">
- <span class="author"><?php echo get_avatar( get_the_author_email(), '18' ); ?> <span class="authname">By: <?php the_author_link(); ?> | <?php the_time('M j, Y / g:i A') ?> CT</span></span>
- </div>
- <?php the_excerpt(); ?>
- </div>
- <?php } else { ?>
- <div id="img">
- <?php
- $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
- foreach ( $attachments as $attachment_id => $attachment ) {
- echo wp_get_attachment_image( $attachment_id, 'thumbnail' );
- } ?>
- </div>
- <div id="right">
- <span class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span>
- <div class="metaauthor">
- <span class="author"><?php echo get_avatar( get_the_author_email(), '18' ); ?> <span class="authname">By: <?php the_author_link(); ?> | <?php the_time('M j, Y / g:i A') ?> CT</span></span>
- </div>
- <?php
- ob_start();
- the_content('Read more');
- $old_content = ob_get_clean();
- $new_content = strip_tags($old_content, '<p><a><b><br /><input><form><textarea><li><ol><ul><table>');
- echo $new_content;
- ?>
- </div>
- <?php } ?>
- </div>
- <?php if ($count == 3) : ?>
- <div id="adbreak">
- <img src="/img/ad300x250.jpg">
- </div>
- <?php endif; $count++; ?>
- <?php endwhile; ?>
- <div class="right"><?php next_posts_link('Next Page »') ?></div>
- <div class="left"><?php previous_posts_link('« Previous Page') ?></div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement