This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

nwn loop

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 4.77 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php $removeDuplicates = array(); ?>
  2.  
  3. <?php  
  4. $my_query = new WP_Query('category_name=Featured&showposts=1');
  5. while ($my_query->have_posts()) : $my_query->the_post();
  6. $do_not_duplicate = $post->ID;
  7. ?>
  8. <?php the_post_thumbnail('home-featured'); ?>
  9. <h2 class="featured-title"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  10. <div id="homecatmetafeat">
  11. By <?php the_author_posts_link(); ?> | <?php if ( function_exists( 'get_relative_date' ) ) {
  12.     echo '' . get_relative_date( get_the_time( 'U' ) ) . ' ago';
  13. } ?> | <span class="comments-link"><?php comments_popup_link( __( 'Comment', 'twentyten' ), __( '1', 'twentyten' ), __( '%', 'twentyten' ) ); ?></span></div>
  14. <?php endwhile; ?>
  15.  
  16. <div id="homecat">
  17.  
  18. <div id="homecatleft">
  19.  
  20. <h4>Recaps & Reviews</h4>
  21.  
  22. <?php
  23. query_posts('category_name=Reviews,Recaps&showposts=1');
  24. if (have_posts()) : while (have_posts()) : the_post();
  25. if( $post->ID == $do_not_duplicate ) continue;
  26. $do_not_duplicate = $post->ID;  //This is the Magic Line
  27. ?>
  28.  
  29. <div class="homecatimg"><?php the_post_thumbnail('home-cat'); ?></div>
  30. <h2 class="cattitle"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  31.  
  32. <div class="homecatmeta">
  33. By <?php the_author_posts_link(); ?> | <?php if ( function_exists( 'get_relative_date' ) ) {
  34.     echo '' . get_relative_date( get_the_time( 'U' ) ) . ' ago';
  35. } ?> | <span class="comments-link"><?php comments_popup_link( __( 'Comment', 'twentyten' ), __( '1', 'twentyten' ), __( '%', 'twentyten' ) ); ?></span></div>
  36. <?php endwhile; ?><?php endif; ?>
  37.  
  38. <?php
  39. query_posts('category_name=Reviews,Recaps&showposts=5');
  40. if (have_posts()) : while (have_posts()) : the_post();
  41. if( $post->ID == $do_not_duplicate ) continue;
  42. $do_not_duplicate = $post->ID;  //This is the Magic Line
  43. ?>
  44. <h2 class="catsubtitle"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  45. <?php endwhile; ?><?php endif; ?>
  46.  
  47. </div>
  48.  
  49. <div id="homecatright">
  50. <h4>Buffy Rewatch</h4>
  51.  
  52. <?php
  53. query_posts('category_name=Buffy Rewatch&showposts=1');
  54. if (have_posts()) : while (have_posts()) : the_post();
  55. if( $post->ID == $do_not_duplicate ) continue;
  56. $do_not_duplicate = $post->ID;  //This is the Magic Line
  57. ?>
  58.  
  59. <div class="homecatimg"><?php the_post_thumbnail('home-cat'); ?></div>
  60. <h2 class="cattitle"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  61.  
  62. <div class="homecatmeta">
  63. By <?php the_author_posts_link(); ?> | <?php if ( function_exists( 'get_relative_date' ) ) {
  64.     echo '' . get_relative_date( get_the_time( 'U' ) ) . ' ago';
  65. } ?> | <span class="comments-link"><?php comments_popup_link( __( 'Comment', 'twentyten' ), __( '1', 'twentyten' ), __( '%', 'twentyten' ) ); ?></span></div>
  66. <?php endwhile; ?><?php endif; ?>
  67.  
  68.  
  69. <?php
  70. query_posts('category_name=Buffy Rewatch&showposts=5');
  71. if (have_posts()) : while (have_posts()) : the_post();
  72. if( $post->ID == $do_not_duplicate ) continue;
  73. $do_not_duplicate = $post->ID;  //This is the Magic Line
  74. ?>
  75. <h2 class="catsubtitle"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  76. <?php endwhile; ?><?php endif; ?>
  77. </div>
  78. </div>
  79.  
  80. <img src="/images/latest.png" style="margin-left:-35px; margin-top: -20px; position: absolute; height: 50px; z-index: 99999;">
  81. <div id="latest">
  82. <?php
  83. query_posts('showposts=8');
  84. if (have_posts()) : while (have_posts()) : the_post();
  85. if( $post->ID == $do_not_duplicate ) continue;
  86. $do_not_duplicate = $post->ID;  //This is the Magic Line
  87. ?>
  88. <div class="latestwrap">
  89. <div class="latestthumb"><?php the_post_thumbnail('thumbnail'); ?></div>
  90.  
  91. <div class="latesttext">
  92. <h2 class="latesttitle"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  93. <?php the_excerpt(); ?>
  94. </div>
  95. </div>
  96. <?php endwhile; endif; ?>
  97.  
  98. </div>
  99.  
  100. <?php /* Display navigation to next/previous pages when applicable */ ?>
  101. <?php if (  $wp_query->max_num_pages > 1 ) : ?>
  102.                                 <BR><BR><div id="nav-below" class="navigation"><div class="nav-previous">
  103.                
  104.                                         <?php if(function_exists('wp_paginate')) {
  105.     wp_paginate();
  106. } ?> </div> <div class="nav-next"></div>
  107.                                 </div><!-- #nav-below -->
  108. <?php endif; ?>
clone this paste RAW Paste Data