Digitalraindrops

Tewnty Ten Index Page 3 Categories

Sep 26th, 2010
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Index Page with three Categories
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Twenty_Ten
  7.  * @since Twenty Ten 1.0
  8.  */
  9.  
  10. get_header(); ?>
  11.  
  12.         <div id="container">
  13.             <div id="content" role="main">
  14.  
  15.             <?php
  16.             /* Run the loop to output the posts.
  17.              * If you want to overload this in a child theme then include a file
  18.              * called loop-index.php and that will be used instead.
  19.              */
  20.  
  21.             /* First Category */
  22.             $catslug = get_category_by_slug('featured');
  23.             $catid = $catslug->term_id;
  24.             query_posts(array(
  25.                 'cat'      => $catid,
  26.                 'posts_per_page'     => 3,
  27.             ));            
  28.            
  29.             //Output the lines
  30.             get_template_part( 'loop', 'index' );
  31.            
  32.             //Reset the Query
  33.             wp_reset_query();
  34.    
  35.             /* Second Category */
  36.             $catslug = get_category_by_slug('latest-news');
  37.             $catid = $catslug->term_id;
  38.             query_posts(array(
  39.                 'cat'      => $catid,
  40.                 'posts_per_page'     => 3,
  41.             ));            
  42.            
  43.             //Output the lines
  44.             get_template_part( 'loop', 'index' );
  45.            
  46.             //Reset the Query
  47.             wp_reset_query();
  48.                
  49.             /* Third Category */
  50.             $catslug = get_category_by_slug('news');
  51.             $catid = $catslug->term_id;
  52.             query_posts(array(
  53.                 'cat'      => $catid,
  54.                 'posts_per_page'     => 3,
  55.             ));            
  56.            
  57.             //Output the lines
  58.             get_template_part( 'loop', 'index' );
  59.            
  60.             //Reset the Query
  61.             wp_reset_query();
  62.    
  63.             ?>
  64.             </div><!-- #content -->
  65.         </div><!-- #container -->
  66.  
  67. <?php get_sidebar(); ?>
  68. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment