Advertisement
Guest User

Custom template with pagination

a guest
Jan 4th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Comunicazioni
  4. */
  5. ?>
  6. <?php get_header(); ?>
  7.  
  8.         <div id="container">
  9.             <div id="content" role="main">
  10.  
  11.  
  12. <?php
  13. $temp = $wp_query;
  14. $wp_query= null;
  15. $wp_query = new WP_Query();
  16. $wp_query->query('showposts=5&cat=9,10'.'&paged='.$paged);
  17. ?>
  18. <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
  19.                      <!-- Display the Title as a link to the Post's permalink. -->
  20.  <h1 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
  21.  
  22.                     <div class="entry-meta">
  23.                         <?php twentyten_posted_on(); ?> <?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span>(', ')</span>' ); ?>
  24.                     </div><!-- .entry-meta -->
  25.  
  26.  <!-- Display the Post's Content in a div box. -->
  27.  <div class="entry-content">
  28.    <?php the_excerpt(); ?>
  29.  </div><br />
  30. <?php endwhile; ?>
  31.  
  32. <div class="navigation">
  33.   <div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
  34.   <div class="alignright"><?php next_posts_link('More &raquo;') ?></div>
  35. </div>
  36. <?php $wp_query = null; $wp_query = $temp;?>
  37.  
  38.             </div><!-- #content -->
  39.         </div><!-- #container -->
  40. <?php get_sidebar(); ?>
  41. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement