Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

WordPress Loops - CB - Pages not displaying

By: a guest on Jan 17th, 2013  |  syntax: None  |  size: 1.53 KB  |  views: 66  |  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.                        
  2. //2 custom WP_Query Loops on the Static Home page
  3.  
  4. <?php // Loop1
  5.                         $first_query = new WP_Query('cat=7&showposts=3');
  6.                         while($first_query->have_posts()) : $first_query->the_post(); ?>
  7.                                 <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  8.                                         <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  9.                                         <?php the_content(); ?>
  10.                                 </div>
  11.                         <?php endwhile; ?>
  12.                         <?php wp_reset_postdata(); ?>
  13.         </ul>
  14.         <p><a href="http://s-usih.org/member-news">Read more Member News</a></p>
  15.     </div><!--.leftcolumn2-->
  16.     <div class="rightcolumn2 recentblog">
  17.         <h1 class="highlight1">Latest Blog</h1>        
  18.                         <?php // Loop2
  19.                 $second_query = new WP_Query('cat=1941&showposts=1');
  20.                 while($second_query->have_posts()) : $second_query->the_post(); ?>
  21.        
  22.                     <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  23.                        
  24.                         <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  25.                         <?php the_content(); ?>
  26.                     </div>
  27.                 <?php endwhile; ?>
  28.                 <?php wp_reset_postdata(); ?>
  29.  
  30. //and 1 main loop on the blogtemplate where main blog is located:
  31.  
  32. <?php query_posts('cat=1941&posts_per_page=3');
  33. if (have_posts()) : while (have_posts()) : the_post(); ?>
  34.  
  35. <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  36. <?php the_content(); ?>
  37. <?php endwhile; endif; ?>
  38. <?php wp_simple_pagination(); ?>       
  39. <?php wp_reset_query(); ?>
clone this paste RAW Paste Data