Advertisement
Guest User

Untitled

a guest
Dec 9th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.31 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php get_sidebar(); ?>
  4.  
  5. <div id="front">
  6.  
  7. <?php if(!is_paged()) { ?>
  8.  
  9. <div class="topstory">
  10. <?php $args = array(
  11. 'cat' => -5,
  12. 'post_type' => array('news','post'),
  13. 'post__in' =>get_option( 'sticky_posts' ),
  14. 'posts_per_page' => 1,
  15. 'tax_query' => array(
  16. array(
  17. 'taxonomy' => 'posttypes',
  18. 'terms' => 11,
  19. 'field' => 'id',
  20. 'operator' => 'NOT IN',
  21. )
  22. )
  23. );
  24. query_posts( $args ); ?>
  25. <?php if( $wp_query->post_count >=2 ) : ?>
  26. <div class="topcolumn">
  27. <?php else : ?>
  28. <div class="toppost">
  29. <?php endif; ?>
  30. <?php $saved_ids = array(); while (have_posts()) : the_post(); ?>
  31. <?php $saved_ids[] = $post->ID; ?>
  32.  
  33. <?php $value = get_post_meta($post->ID, 'type', true) ?>
  34. <?php if($value == 'bigstory') { ?>
  35. <div id="post-<?php the_ID(); ?>" <?php post_class('post-big-story'); ?>>
  36. <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>
  37. <?php
  38. $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
  39. foreach ( $attachments as $attachment_id => $attachment ) {
  40. echo wp_get_attachment_image( $attachment_id, 'Front Big Story' );
  41. } ?>
  42. <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);
  43. $thumb_images = get_posts($args);
  44. foreach ($thumb_images as $thumb_image) {
  45. if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
  46. }
  47. ?></div>
  48. <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
  49. <?php the_excerpt(); ?>
  50. <ul class="group-items">
  51. <?php
  52. $taxonomies = get_post_meta($post->ID, 'groupid', true);
  53. $myq = new WP_Query('groupitems='.$taxonomies);
  54. if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
  55. <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>
  56. <?php endwhile; else:?>
  57. </ul>
  58. <?php endif;?>
  59. <?php }?>
  60. </div>
  61. <?php } elseif($value == 'breakingnews') { ?>
  62. <div id="post-<?php the_ID(); ?>" <?php post_class('post-breaking-news'); ?>>
  63. <div id="img">
  64. <?php
  65. $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
  66. foreach ( $attachments as $attachment_id => $attachment ) {
  67. echo wp_get_attachment_image( $attachment_id, 'Front Big Story' );
  68. } ?>
  69. <h2><div id="breakingtitle">Developing:</div></h2>
  70. </div>
  71.  
  72. <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>
  73. <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);
  74. $thumb_images = get_posts($args);
  75. foreach ($thumb_images as $thumb_image) {
  76. if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
  77. }
  78. ?></div>
  79. <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
  80. <?php the_excerpt(); ?>
  81. <ul class="group-items">
  82. <?php
  83. $taxonomies = get_post_meta($post->ID, 'groupid', true);
  84. $myq = new WP_Query('groupitems='.$taxonomies);
  85. if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
  86. <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>
  87. <?php endwhile; else:?>
  88. </ul>
  89. <?php endif;?>
  90. <?php }?>
  91. </div>
  92. <?php } elseif($value == 'groupfront') { ?>
  93. <div id="post-<?php the_ID(); ?>" <?php post_class('post-group'); ?>>
  94. <div id="img">
  95. <?php
  96. $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
  97. foreach ( $attachments as $attachment_id => $attachment ) {
  98. echo wp_get_attachment_image( $attachment_id, 'Front Group' );
  99. } ?>
  100. <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>
  101. </div>
  102. <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);
  103. $thumb_images = get_posts($args);
  104. foreach ($thumb_images as $thumb_image) {
  105. if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
  106. }
  107. ?></div>
  108. <?php the_excerpt(); ?>
  109. <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
  110. <ul class="group-items">
  111. <?php
  112. $taxonomies = get_post_meta($post->ID, 'groupid', true);
  113. $myq = new WP_Query('groupitems='.$taxonomies);
  114. if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
  115. <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>
  116. <?php endwhile; else:?>
  117. </ul>
  118. <?php endif;?>
  119. <?php }?>
  120. </div>
  121. <?php } else { ?>
  122. <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
  123. <div id="img">
  124. <?php
  125. $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
  126. foreach ( $attachments as $attachment_id => $attachment ) {
  127. echo wp_get_attachment_image( $attachment_id, 'Front' );
  128. } ?>
  129. </div>
  130. <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>
  131. <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);
  132. $thumb_images = get_posts($args);
  133. foreach ($thumb_images as $thumb_image) {
  134. if($thumb_image->post_excerpt) echo 'Image: ' . $thumb_image->post_excerpt;
  135. }
  136. ?></div>
  137. <?php
  138. ob_start();
  139. the_content('',FALSE,'');
  140. $old_content = ob_get_clean();
  141. $new_content = strip_tags($old_content, '<p><a><b><br /><input><form><textarea><li><ol><ul><table>');
  142. echo $new_content; ?>
  143. <?php if ( get_post_meta($post->ID, 'grouping', 'on') ) { ?>
  144. <ul class="group-items">
  145. <?php
  146. $taxonomies = get_post_meta($post->ID, 'groupid', true);
  147. $myq = new WP_Query('groupitems='.$taxonomies);
  148. if ($myq->have_posts()) : while ($myq->have_posts()) : $myq->the_post(); // the loop ?>
  149. <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>
  150. <?php endwhile; else:?>
  151. </ul>
  152. <?php endif;?>
  153. <?php }?>
  154. </div>
  155. <?php } ?>
  156. <?php?>
  157.  
  158. <?php endwhile; ?>
  159. </div>
  160.  
  161. </div>
  162.  
  163. <?php } ?>
  164.  
  165.  
  166. <div id="countrydivcontainer">
  167. <?php wp_reset_query(); ?>
  168. <?php $count = 1; ?>
  169. <?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')))); ?>
  170. <?php while ($my_query2->have_posts()) : $my_query2->the_post(); if ($post->ID == $displayed) continue;?>
  171. <div id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>
  172. <?php if ( 'news' == get_post_type() ) { ?>
  173. <div id="img">
  174. <img src="/img/cnetnews.jpg">
  175. <h2><span>Partner site:</span></h2>
  176. </div>
  177. <div id="right">
  178. <?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 }?>
  179. <span class="date">Posted: <?php the_time('M j, Y / g:i A') ?> CT</span>
  180. <?php the_excerpt(); ?>
  181. </div>
  182. <?php } elseif ( in_category('7') ) { ?>
  183. <div id="img">
  184. <span class="galleryimg"><?php the_post_thumbnail(); ?></span>
  185. </div>
  186. <div id="right">
  187. <span class="title"><a href="<?php the_permalink() ?>">Gallery: <?php the_title(); ?></a></span>
  188. <div class="metaauthor">
  189. <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>
  190. </div>
  191. <?php the_excerpt(); ?>
  192. </div>
  193. <?php } else { ?>
  194. <div id="img">
  195. <?php
  196. $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
  197. foreach ( $attachments as $attachment_id => $attachment ) {
  198. echo wp_get_attachment_image( $attachment_id, 'thumbnail' );
  199. } ?>
  200. </div>
  201. <div id="right">
  202. <span class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span>
  203. <div class="metaauthor">
  204. <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>
  205. </div>
  206. <?php
  207. ob_start();
  208. the_content('Read more');
  209. $old_content = ob_get_clean();
  210. $new_content = strip_tags($old_content, '<p><a><b><br /><input><form><textarea><li><ol><ul><table>');
  211. echo $new_content;
  212. ?>
  213. </div>
  214. <?php } ?>
  215. </div>
  216.  
  217. <?php if ($count == 3) : ?>
  218. <div id="adbreak">
  219. <img src="/img/ad300x250.jpg">
  220. </div>
  221. <?php endif; $count++; ?>
  222. <?php endwhile; ?>
  223.  
  224. <div class="right"><?php next_posts_link('Next Page &raquo;') ?></div>
  225. <div class="left"><?php previous_posts_link('&laquo; Previous Page') ?></div>
  226.  
  227. </div>
  228.  
  229. <?php get_footer(); ?>
  230.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement