Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php /* Template Name: Home */ ?>
- <?php get_header(); ?>
- <div id="container" class="col8">
- <div id="content">
- <?php
- // 3 seperate Loops each containing its own category:
- // 1st Loop Category - Blog
- // 2nd Loop Category - Project
- // 3rd Loop Category - tutorial
- ?>
- <?php //Blog Loop
- $do_not_duplicate = array(); ?>
- <?php $blog_loop = new WP_Query('category_name=blog&posts_per_page=1');
- while ($blog_loop->have_posts()) : $blog_loop->the_post();
- $do_not_duplicate[] = $post->ID;
- ?>
- <div id="blog-post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="blog-entry-content">
- <?php the_content(); ?>
- </div><!-- .entry-content -->
- </div><!-- #post-<?php the_ID(); ?> -->
- <?php endwhile; ?>
- <?php wp_reset_postdata() ?>
- <?php //Project Loop ?>
- <?php $project_loop = new WP_Query(array( 'category_name' => 'project', 'posts_per_page' => 1, 'post__not_in' => $do_not_duplicate ));
- while ($project_loop->have_posts()) : $project_loop->the_post();
- $do_not_duplicate[] = $post->ID;
- ?>
- <div id="project-post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="project-entry-content">
- <?php the_content(); ?>
- </div><!-- .entry-content -->
- </div><!-- #post-<?php the_ID(); ?> -->
- <?php endwhile; ?>
- <?php wp_reset_postdata() ?>
- <?php //Tutorials Loop ?>
- <?php $tutorial_loop = new WP_Query(array( 'category_name' => 'tutorial', 'posts_per_page' => 5, 'post__not_in' => $do_not_duplicate )) ;
- while ($tutorial_loop->have_posts()) : $tutorial_loop->the_post();
- $do_not_duplicate[] = $post->ID;
- ?>
- <div id="tutorial-post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="tutorial-entry-content">
- <?php the_content(); ?>
- </div><!-- .entry-content -->
- </div><!-- #post-<?php the_ID(); ?> -->
- <?php endwhile; ?>
- <?php wp_reset_postdata() ?>
- </div><!-- #content -->
- <?php get_sidebar(); ?>
- </div><!-- #container -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement