Advertisement
Guest User

wp-cust-loop

a guest
Sep 24th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Template Name: Weekly Recipes Page
  4.  */
  5. get_header(); ?>
  6.  
  7.     <section class="all">
  8.     <?php get_sidebar(); ?>
  9.         <section class="contentSideBar">
  10.            
  11.             <header>
  12.                 <h3>Latest Recipes:</h3>
  13.             </header>
  14.            
  15.             <?php
  16.                 query_posts('cat=29&showposts=12');
  17.                 $ids = array();
  18.                 while (have_posts()) : the_post();
  19.                 $ids[] = get_the_ID();
  20.                 echo '<article>';
  21.                 echo '<a href="'; the_permalink(); echo '">';
  22.                 the_post_thumbnail();
  23.                 echo '<h1>'; the_title(); echo '</h1></a>';
  24.                 echo '</article>';
  25.                 endwhile;
  26.             ?>
  27.     <?php /* Display navigation to next/previous pages when applicable */ ?>
  28.     <?php if (  $wp_query->max_num_pages > 1 ) : ?>
  29.         <div class="prevNext">
  30.             <p class="nextPostsLink"><?php next_posts_link( __( '&larr; Older posts', 'twentyten' ) ); ?></p>
  31.             <p class="previousPostsLink"><?php previous_posts_link( __( 'Newer posts &rarr;', 'twentyten' ) ); ?></p>
  32.         </div>
  33.     <?php endif; ?>
  34.  
  35.         </section>
  36.     </section><!--//.all-->
  37.  
  38. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement