Advertisement
Guest User

Untitled

a guest
Oct 18th, 2011
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. <?php
  2. /**
  3. * The main template file.
  4. *
  5. * This is the most generic template file in a WordPress theme
  6. * and one of the two required files for a theme (the other being style.css).
  7. * It is used to display a page when nothing more specific matches a query.
  8. * E.g., it puts together the home page when no home.php file exists.
  9. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  10. *
  11. * @package WordPress
  12. * @subpackage Twenty_Eleven
  13. */
  14.  
  15. get_header(); ?>
  16.  
  17. <div id="primary">
  18. <div id="content" role="main">
  19.  
  20. <?php if ( have_posts() ) : ?>
  21.  
  22. <?php twentyeleven_content_nav( 'nav-above' ); ?>
  23. <?php $my_query = new WP_Query('cat=1&posts_per_page=1'); ?>
  24. <?php /* Start of first the Loop */ ?>
  25. <?php while ($my_query->have_posts()) : $my_query->the_post();?>
  26. <?php get_template_part( 'content', get_post_format() ); ?>
  27. <?php endwhile; ?>
  28.  
  29. <?php
  30. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  31. $args = array(
  32. 'cat' => -1, // category ID you want to exclude
  33. 'posts_per_page' => 5,
  34. 'paged' => $paged
  35. );
  36. query_posts($args);
  37. ?>
  38. <?php /* Start of second Loop */ ?>
  39.  
  40. <?php while ( have_posts() ) : the_post(); ?>
  41.  
  42. <?php get_template_part( 'content', get_post_format() ); ?>
  43.  
  44. <?php endwhile; ?>
  45.  
  46. <?php twentyeleven_content_nav( 'nav-below' ); ?>
  47.  
  48. <?php else : ?>
  49.  
  50. <article id="post-0" class="post no-results not-found">
  51. <header class="entry-header">
  52. <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  53. </header><!-- .entry-header -->
  54.  
  55. <div class="entry-content">
  56. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  57. <?php get_search_form(); ?>
  58. </div><!-- .entry-content -->
  59. </article><!-- #post-0 -->
  60.  
  61. <?php endif; ?>
  62.  
  63. </div><!-- #content -->
  64. </div><!-- #primary -->
  65.  
  66. <?php get_sidebar(); ?>
  67. <?php get_footer(); ?>
  68.  
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement