Advertisement
aldolat

Untitled

Sep 2nd, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. Template Name: Blog
  4. */
  5. ?>
  6. <?php
  7. /**
  8.  * The template for displaying all pages.
  9.  *
  10.  * This is the template that displays all pages by default.
  11.  * Please note that this is the WordPress construct of pages
  12.  * and that other 'pages' on your WordPress site will use a
  13.  * different template.
  14.  *
  15.  * @package Toolbox
  16.  * @since Toolbox 0.1
  17.  */
  18.  
  19. get_header(); ?>
  20.  
  21.         <div id="primary">
  22.             <div id="content" role="main">
  23.                 <?php while ( have_posts() ) : the_post(); ?>
  24.                     <?php get_template_part( 'content', 'page' ); ?>
  25.                    
  26.                     <?php
  27.                     if(is_front_page() || is_home()) {
  28.                         include (ABSPATH . '/wp-content/plugins/coin-slider-4-wp/coinslider.php');
  29.                     } ?>
  30.  
  31.                     <?php
  32.                         $args = array(
  33.                             'posts_per_page' => 2,
  34.                             'paged'          => get_query_var( 'paged' )
  35.                         );
  36.  
  37.                         $myposts = new WP_Query( $args ); ?>
  38.  
  39.                         <?php if( $myposts->have_posts() ) : ?>
  40.  
  41.                             <ul>
  42.                                 <?php while( $myposts->have_posts() ) : $myposts->the_post(); ?>
  43.                                     <li>
  44.                                         <p>
  45.                                             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
  46.                                                 <?php the_title(); ?>
  47.                                             </a>
  48.                                         </p>
  49.                                         <p>
  50.                                             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
  51.                                                 <?php the_post_thumbnail( 'medium' ); ?>
  52.                                             </a>
  53.                                         </p>
  54.                                         <p><?php the_excerpt(); ?></p>
  55.                                     </li>
  56.                                 <?php endwhile; ?>
  57.                             </ul>
  58.  
  59.                             <nav id="nav-below">
  60.                                 <div class="nav-previous">
  61.                                     <?php next_posts_link( '&larr; Pagina precedente', $myposts->max_num_pages ); ?>
  62.                                 </div>
  63.                                 <div class="nav-next">
  64.                                     <?php previous_posts_link( 'Pagina successiva &rarr;', $myposts->max_num_pages ); ?>
  65.                                 </div>
  66.                             </nav>
  67.  
  68.                         <?php endif; ?>
  69.  
  70.                         <?php wp_reset_postdata(); ?>
  71.  
  72.                     <?php comments_template( '', true ); ?>
  73.  
  74.                 <?php endwhile; // end of the loop. ?>
  75.  
  76.             </div><!-- #content -->
  77.         </div><!-- #primary -->
  78.  
  79. <?php get_sidebar(); ?>
  80. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement