Advertisement
Guest User

Twenty Ten front page attempt

a guest
Feb 20th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Snarfer
  4. */
  5. ?>
  6. <?php
  7. /**
  8.  * The main template file.
  9.  *
  10.  * This is the most generic template file in a WordPress theme
  11.  * and one of the two required files for a theme (the other being style.css).
  12.  * It is used to display a page when nothing more specific matches a query.
  13.  * E.g., it puts together the home page when no home.php file exists.
  14.  * Learn more: http://codex.wordpress.org/Template_Hierarchy
  15.  *
  16.  * @package WordPress
  17.  * @subpackage Twenty_Ten
  18.  * @since Twenty Ten 1.0
  19.  */
  20.  
  21. get_header(); ?>
  22.  
  23.         <div id="container">
  24.             <div id="content" role="main">
  25.  
  26.             <?php
  27.             /* Run the loop to output the page.
  28.              * If you want to overload this in a child theme then include a file
  29.              * called loop-page.php and that will be used instead.
  30.              */
  31.             get_template_part( 'loop', 'page' );
  32.  
  33. $latest_blog_posts = new WP_Query( array( 'posts_per_page' => 3 ) );
  34.  
  35. if ( $latest_blog_posts->have_posts() ) : while ( $latest_blog_posts->have_posts() ) : $latest_blog_posts->the_post();
  36.     get_template_part( 'loop', 'index' );
  37. endwhile; endif;
  38.             ?>
  39.  
  40.             </div><!-- #content -->
  41.         </div><!-- #container -->
  42.  
  43. <?php get_sidebar(); ?>
  44. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement