Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Portfolio Page Template

By: Zeaks on Nov 6th, 2012  |  syntax: PHP  |  size: 1.21 KB  |  views: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. /**
  3.  *
  4.  * Template Name: Portfolio Template
  5.  *
  6.  */
  7.  
  8. get_header(); ?>
  9.  
  10.         <div id="primary" class="site-content">
  11.                 <div id="content" role="main">
  12.                         <div class="portfolio-slider">
  13.                         <!-- Change number 5 to amount of slides you want to show -->
  14.                         <?php if(function_exists('show_featured_posts')) echo show_featured_posts('5'); ?>
  15.                         </div> <!-- .grid-slider -->
  16.                         <div class="section group">
  17.                         <?php
  18.                         /* Run the loop to output the posts.
  19.                          * If you want to overload this in a child theme then include a file
  20.                          * called loop-index.php and that will be used instead.
  21.                          */
  22.                          // fix for pagination on static homepage                        
  23.                         global $paged, $wp_query, $wp;
  24.                         $args = wp_parse_args($wp->matched_query);
  25.                         if ( !empty ( $args['paged'] ) ) {
  26.                                 $wp_query->set('paged', $args['paged']);
  27.                                 $paged = $args['paged'];
  28.                         }
  29.                          
  30.                          $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  31.                          query_posts('cat=0&posts_per_page=4&paged='.$paged); //set your own query here
  32.                          get_template_part( 'loop', 'portfolio' );
  33.                          
  34.                          wp_reset_query();
  35.                         ?>
  36.                         </div><!-- .section group -->
  37.                 </div><!-- #content -->
  38.         </div><!-- #primary -->
  39. <?php get_sidebar( 'front' ); ?>
  40. <?php get_footer(); ?>