Advertisement
Guest User

Untitled

a guest
May 14th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Portfolio 4 columns
  4. */
  5.  
  6. get_header(); ?>
  7.  
  8. <div id="content" class="grid_16">
  9. <?php include_once (TEMPLATEPATH . '/title.php');?>
  10. <?php global $more; $more = 0;?>
  11. <?php $values = get_post_custom_values("category-include"); $cat=$values[0]; ?>
  12. <?php $catinclude = 'portfolio_category='. $cat ;?>
  13.  
  14. <?php $temp = $wp_query;
  15. $wp_query= null;
  16. $wp_query = new WP_Query(); ?>
  17. <?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&showposts=12'); ?>
  18. <?php if ( ! have_posts() ) : ?>
  19. <div id="post-0" class="post error404 not-found">
  20. <h1 class="entry-title"><?php _e( 'Not Found', 'theme1539' ); ?></h1>
  21. <div class="entry-content">
  22. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'theme1539' ); ?></p>
  23. <?php get_search_form(); ?>
  24. </div><!-- .entry-content -->
  25. </div><!-- #post-0 -->
  26. <?php endif; ?>
  27. <div id="gallery" class="four_columns">
  28. <ul class="portfolio">
  29. <?php
  30. $i=1;
  31. if ( have_posts() ) while ( have_posts() ) : the_post();
  32. if(($i%4) == 0){ $addclass = "nomargin"; }
  33. ?>
  34.  
  35.  
  36. <?php
  37. $custom = get_post_custom($post->ID);
  38. $lightbox = $custom["lightbox-url"][0];
  39.  
  40. ?>
  41.  
  42. <li class="<?php echo $addclass; ?>">
  43. <?php if($lightbox!=""){ ?>
  44. <span class="image-border"><a class="image-wrap" href="<?php echo $lightbox;?>" rel="prettyPhoto[gallery]" title="<?php the_title();?>"><?php the_post_thumbnail( 'portfolio-post-thumbnail-small' ); ?><span class="zoom-icon"><span class="text"><?php _e('ZOOM','theme1539'); ?></span></span></a></span>
  45. <?php }else{ ?>
  46. <span class="image-border"><a class="image-wrap" href="<?php the_permalink() ?>" title="<?php _e('Permanent Link to', 'theme1539');?> <?php the_title_attribute(); ?>" ><?php the_post_thumbnail( 'portfolio-post-thumbnail-small' ); ?></a></span>
  47. <?php } ?>
  48. <div class="folio-desc">
  49. <h3><a href="<?php the_permalink(); ?>"><?php $title = the_title('','',FALSE); echo substr($title, 0, 40); ?></a></h3>
  50. <span class="meta"><?php the_terms('post->ID','portfolio_category','',', '); ?></span>
  51. </div>
  52. </li>
  53.  
  54.  
  55. <?php $i++; $addclass = ""; endwhile; ?>
  56. </ul>
  57. <div class="clear"></div>
  58. </div>
  59.  
  60.  
  61.  
  62.  
  63.  
  64. <?php if(function_exists('wp_pagenavi')) : ?>
  65. <?php wp_pagenavi(); ?>
  66. <?php else : ?>
  67. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  68. <nav class="oldernewer">
  69. <div class="older">
  70. <?php next_posts_link( __('&laquo; Older Entries', 'theme1539')) ?>
  71. </div><!--.older-->
  72. <div class="newer">
  73. <?php previous_posts_link(__('Newer Entries &raquo;', 'theme1539')) ?>
  74. </div><!--.newer-->
  75. </nav><!--.oldernewer-->
  76. <?php endif; ?>
  77. <?php endif; ?>
  78. <!-- Page navigation -->
  79.  
  80. <?php $wp_query = null; $wp_query = $temp;?>
  81. </div><!-- #content -->
  82. <!-- end #main -->
  83. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement