Advertisement
Guest User

Twenty Ten Front Page template

a guest
Feb 22nd, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Twenty Ten Front Page
  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.  
  34. <?php query_posts('posts_per_page=3'); ?>
  35. <?php while (have_posts()) : the_post(); ?>
  36. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  37. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  38.  
  39. <div class="entry-meta">
  40. <?php twentyten_posted_on(); ?>
  41. </div><!-- .entry-meta -->
  42.  
  43. <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
  44. <div class="entry-summary">
  45. <?php the_excerpt(); ?>
  46. </div><!-- .entry-summary -->
  47. <?php else : ?>
  48. <div class="entry-content">
  49. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
  50. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
  51. </div><!-- .entry-content -->
  52. <?php endif; ?>
  53.  
  54. <div class="entry-utility">
  55. <?php if ( count( get_the_category() ) ) : ?>
  56. <span class="cat-links">
  57. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  58. </span>
  59. <span class="meta-sep">|</span>
  60. <?php endif; ?>
  61. <?php
  62. $tags_list = get_the_tag_list( '', ', ' );
  63. if ( $tags_list ):
  64. ?>
  65. <span class="tag-links">
  66. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  67. </span>
  68. <span class="meta-sep">|</span>
  69. <?php endif; ?>
  70. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  71. <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  72. </div><!-- .entry-utility -->
  73. </div><!-- #post-## -->
  74.  
  75. <?php comments_template( '', true ); ?>
  76.  
  77. <?php /* Display navigation to next/previous pages when applicable */ ?>
  78. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  79. <div id="nav-below" class="navigation">
  80. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  81. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  82. </div><!-- #nav-below -->
  83. <?php endif; ?>
  84.  
  85. <?php endwhile;?>
  86.  
  87.  
  88. </div><!-- #content -->
  89. </div><!-- #container -->
  90.  
  91. <?php get_sidebar(); ?>
  92. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement