Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Index Page with three Categories
- *
- * @package WordPress
- * @subpackage Twenty_Ten
- * @since Twenty Ten 1.0
- */
- get_header(); ?>
- <div id="container">
- <div id="content" role="main">
- <?php
- /* Run the loop to output the posts.
- * If you want to overload this in a child theme then include a file
- * called loop-index.php and that will be used instead.
- */
- /* First Category */
- $catslug = get_category_by_slug('featured');
- $catid = $catslug->term_id;
- query_posts(array(
- 'cat' => $catid,
- 'posts_per_page' => 3,
- ));
- //Output the lines
- get_template_part( 'loop', 'index' );
- //Reset the Query
- wp_reset_query();
- /* Second Category */
- $catslug = get_category_by_slug('latest-news');
- $catid = $catslug->term_id;
- query_posts(array(
- 'cat' => $catid,
- 'posts_per_page' => 3,
- ));
- //Output the lines
- get_template_part( 'loop', 'index' );
- //Reset the Query
- wp_reset_query();
- /* Third Category */
- $catslug = get_category_by_slug('news');
- $catid = $catslug->term_id;
- query_posts(array(
- 'cat' => $catid,
- 'posts_per_page' => 3,
- ));
- //Output the lines
- get_template_part( 'loop', 'index' );
- //Reset the Query
- wp_reset_query();
- ?>
- </div><!-- #content -->
- </div><!-- #container -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment