Advertisement
grappler

portfolio.php

Sep 28th, 2012
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.71 KB | None | 0 0
  1. <?php
  2.  
  3. // Exit if accessed directly
  4. if ( !defined('ABSPATH')) exit;
  5.  
  6. /**
  7.  * Portfolio Template
  8.  *
  9.    Template Name: Portfolio
  10.  *
  11.  * @file           portfolio.php
  12.  * @package        Responsive
  13.  * @author         Emil Uzelac
  14.  * @copyright      2003 - 2012 ThemeID
  15.  * @license        license.txt
  16.  * @version        Release: 1.0
  17.  * @filesource     wp-content/themes/responsive/portfolio.php
  18.  * @link           http://codex.wordpress.org/Templates
  19.  * @since          available since Release 1.0
  20.  */
  21. ?>
  22. <?php get_header(); ?>
  23. <?php global $more; $more = 0; ?>
  24.         <div id="content-blog" class="grid col-940">
  25. <?php
  26.     if ( get_query_var('paged') )
  27.         $paged = get_query_var('paged');
  28.     elseif ( get_query_var('page') )
  29.         $paged = get_query_var('page');
  30.     else
  31.         $paged = 1;
  32.         query_posts("post_type=post&paged=$paged&category_name=portfolio");
  33. ?>
  34. <?php if (have_posts()) : ?>
  35.  
  36.         <?php $c = 0;while (have_posts()) : the_post(); $c++;
  37.             if( $c == 3) {
  38.                 $style = 'grid col-300 fit';
  39.                 $c = 0;
  40.             }
  41.             else $style='grid col-300';
  42.         ?>
  43.        
  44.             <div id="post-<?php the_ID(); ?>" <?php post_class($style); ?>>
  45.                
  46.                 <h1 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'responsive'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h1>
  47.                
  48.                 <div class="post-meta">
  49.                 <?php
  50.                     printf( __( '<span class="%1$s">Posted on</span> %2$s by %3$s', 'responsive' ),'meta-prep meta-prep-author',
  51.                     sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  52.                         get_permalink(),
  53.                         esc_attr( get_the_time() ),
  54.                         get_the_date()
  55.                     ),
  56.                     sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  57.                         get_author_posts_url( get_the_author_meta( 'ID' ) ),
  58.                     sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ),
  59.                         get_the_author()
  60.                         )
  61.                     );
  62.                 ?>
  63.                     <?php if ( comments_open() ) : ?>
  64.                         <span class="comments-link">
  65.                         <span class="mdash">&mdash;</span>
  66.                     <?php comments_popup_link(__('No Comments &darr;', 'responsive'), __('1 Comment &darr;', 'responsive'), __('% Comments &darr;', 'responsive')); ?>
  67.                         </span>
  68.                     <?php endif; ?>
  69.                 </div><!-- end of .post-meta -->
  70.                
  71.                 <div class="post-entry">
  72.                     <?php if ( has_post_thumbnail()) : ?>
  73.                         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  74.                     <?php the_post_thumbnail(); ?>
  75.                         </a>
  76.                     <?php endif; ?>
  77.                     <?php the_content(__('Read more &#8250;', 'responsive')); ?>
  78.                     <?php wp_link_pages(array('before' => '<div class="pagination">' . __('Pages:', 'responsive'), 'after' => '</div>')); ?>
  79.                 </div><!-- end of .post-entry -->
  80.                
  81.                 <div class="post-data">
  82.                     <?php the_tags(__('Tagged with:', 'responsive') . ' ', ', ', '<br />'); ?>
  83.                     <?php printf(__('Posted in %s', 'responsive'), get_the_category_list(', ')); ?>
  84.                 </div><!-- end of .post-data -->            
  85.  
  86.             <div class="post-edit"><?php edit_post_link(__('Edit', 'responsive')); ?></div>              
  87.             </div><!-- end of #post-<?php the_ID(); ?> -->
  88.            
  89.         <?php endwhile; ?>
  90.        
  91.         <?php if (  $wp_query->max_num_pages > 1 ) : ?>
  92.         <div class="navigation">
  93.             <div class="previous"><?php next_posts_link( __( '&#8249; Older posts', 'responsive' ) ); ?></div>
  94.             <div class="next"><?php previous_posts_link( __( 'Newer posts &#8250;', 'responsive' ) ); ?></div>
  95.         </div><!-- end of .navigation -->
  96.         <?php endif; ?>
  97.  
  98.         <?php else : ?>
  99.  
  100.         <h1 class="title-404"><?php _e('404 &#8212; Fancy meeting you here!', 'responsive'); ?></h1>
  101.         <p><?php _e('Don&#39;t panic, we&#39;ll get through this together. Let&#39;s explore our options here.', 'responsive'); ?></p>
  102.         <h6><?php _e( 'You can return', 'responsive' ); ?> <a href="<?php echo home_url(); ?>/" title="<?php esc_attr_e( 'Home', 'responsive' ); ?>"><?php _e( '&larr; Home', 'responsive' ); ?></a> <?php _e( 'or search for the page you were looking for', 'responsive' ); ?></h6>
  103.         <?php get_search_form(); ?>
  104.        
  105. <?php endif; ?>  
  106.      
  107.         </div><!-- end of #content-blog -->
  108.  
  109. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement