Advertisement
Guest User

Untitled

a guest
Dec 14th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement