Advertisement
ovizii

Custom Home Template

May 31st, 2011
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Template Name: Custom Home
  4.  *
  5.  */
  6.  
  7. get_header(); // Loads the header.php template. ?>
  8.  
  9. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
  10. <script type="text/javascript">
  11. //<![CDATA[
  12. function ShowHide(){
  13. $("#comments-template").animate({"height": "toggle"}, { duration: 1000 });
  14. }
  15. //]]>
  16. </script>
  17. <style media="screen" type="text/css">
  18. #comments-template {display: none;}
  19. </style>
  20.  
  21.     <div id="content" class="hfeed content">
  22.  
  23.         <?php do_atomic( 'before_content' ); // hybrid_before_content ?>
  24.  
  25. <?php
  26.     $args = wp_parse_args( $query_string );
  27.     $paged = isset( $args['paged'] ) ? absint( $args['paged'] ) : 1;
  28.     query_posts( array( 'posts_per_page' => '1', 'paged' => $paged ) );
  29. ?>
  30.  
  31.         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  32.  
  33.             <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
  34.  
  35.                 <?php do_atomic( 'before_entry' ); // hybrid_before_entry ?>
  36.                 <a onclick="ShowHide(); return false;" href="#">Show/hide comments</a>
  37.                 <?php $withcomments = true; ?>
  38.                 <?php comments_template(); ?>              
  39.                 <div class="entry-content">
  40.                     <?php the_content( sprintf( __( 'Continue reading %1$s', hybrid_get_textdomain() ), the_title( ' "', '"', false ) ) ); ?>
  41.                     <?php wp_link_pages( array( 'before' => '<p class="page-links pages">' . __( 'Pages:', hybrid_get_textdomain() ), 'after' => '</p>' ) ); ?>
  42.                 </div><!-- .entry-content -->
  43.  
  44.                 <?php do_atomic( 'after_entry' ); // hybrid_after_entry ?>
  45.  
  46.             </div><!-- .hentry -->
  47.  
  48.  
  49.             <?php endwhile; ?>
  50.  
  51.             <?php do_atomic( 'after_singular' ); // hybrid_after_singular ?>
  52.  
  53.         <?php else: ?>
  54.  
  55.             <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
  56.  
  57.         <?php endif; ?>
  58.  
  59.         <?php do_atomic( 'after_content' ); // hybrid_after_content ?>
  60.  
  61.     </div><!-- .content .hfeed -->
  62.  
  63. <?php get_footer(); // Loads the footer.php template. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement