Advertisement
Digitalraindrops

Category Loop 3

May 30th, 2011
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <!-- FILE: page.php -->
  2. <?php get_header(); ?>
  3.  
  4. <div id class="content_container"> <?php get_sidebar(); ?>
  5.     <div id class="main_content">
  6.         <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  7.         <h1><?php the_title(); ?></h1>
  8.         <?php
  9.            global $post;
  10.            $template_names = array();
  11.            $template_names[]='loop-' .$post->post_name .'.php';
  12.            $template_names[]='loop-page.php';
  13.            locate_template( $template_names, true, true );
  14.         ?>
  15.     </div>
  16. </div>
  17. <?php endwhile; ?>
  18.  
  19. <?php get_footer(); ?>
  20.  
  21.  
  22.  
  23. <!-- FILE: loop-portfolio.php -->
  24. <?php query_posts('category_name=portfolio&posts_per_page=3'); ?>
  25.     <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  26.     <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  27.         <div class="post_title"><h1><?php the_title(); ?></h1></div>
  28.         <div id class="picbox"></div>
  29.         <p><?php the_content(); ?></p>
  30.     </div>
  31.     <div id class="clear"></div>
  32. <?php endwhile; ?>
  33. <?php rewind_posts(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement