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

Untitled

By: a guest on Dec 14th, 2013  |  syntax: PHP  |  size: 0.94 KB  |  views: 43  |  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
  2.  
  3. get_header();
  4.  
  5. // Categories to be excluded from the main loop
  6.  
  7. // get_category_id is a function i made in functions.php that takes a name as a parameter and returns that categories
  8. // id
  9. $cat1 = get_category_id("cat1");
  10. $cat2 = get_category_id("cat2");
  11. $cat3 = get_category_id("cat3");
  12.  
  13. $categories = array($swiss, $supper, $thoughts);
  14.  
  15. $args = array(
  16.         'category__not_in' => $categories
  17. );
  18.  
  19. $the_query = new WP_Query($args);
  20.  
  21. ?>
  22.  
  23.  
  24. <section class="main_content">
  25.         <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  26.                
  27.                 <?php get_template_part('content', 'post'); ?>
  28.        
  29.         <?php endwhile; else: ?>
  30.                 No pages or posts available.
  31.         <?php
  32.                 endif;
  33.         ?>
  34.  
  35.         <div class="pagination_container">
  36.                 // borrowing the pagination plugin found on kriesi.at
  37.                 <?php kriesi_pagination(); ?>
  38.         </div>
  39.  
  40. </section>
  41.  
  42. <?php
  43.         wp_reset_postdata();
  44.         get_sidebar();
  45.         get_footer();
  46. ?>
clone this paste RAW Paste Data