gcoghill

grid template CPT

Sep 9th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Stock Art
  4. */
  5. ?>
  6. <?php
  7. /**
  8. * The template for displaying Archive pages.
  9. *
  10. * Used to display archive-type pages if nothing more specific matches a query.
  11. * For example, puts together date-based pages if no date.php file exists.
  12. *
  13. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  14. *
  15. * @package WordPress
  16. * @subpackage Twenty_Ten
  17. * @since Twenty Ten 1.0
  18. */
  19.  
  20. get_header(); ?>
  21.  
  22. <div id="container">
  23. <div id="content" role="main">
  24.  
  25.  
  26.  
  27.  
  28. <h1 class="entry-title" align="center">
  29. Stock Illustration - Coghill Cartooning
  30. </h1>
  31. <!-- thumbnail grid code grabbed here: http://return-true.com/2010/05/creating-a-post-thumbnail-grid-in-wordpress/ -->
  32. <div id="gridContainer" align="center">
  33. <?php
  34. $c = 1; //init counter
  35. $bpr = 3; //boxes per row
  36. query_posts( $query_string . '&posts_per_page=21' );
  37. if(have_posts()) :
  38. while(have_posts()) :
  39. the_post();
  40. ?>
  41. <div class="image-grid" id="post-<?php the_ID(); ?>">
  42. <div class="postImage">
  43. <a href="<?php the_permalink(); ?>" title="Cartoon <?php echo get_post_meta( get_the_ID(), 'stock-art-name', true ); ?> clipart"><?php the_post_thumbnail('thumbnail'); ?></a>
  44. <h1 class="page-title"><a href="<?php the_permalink(); ?>" title="Cartoon <?php echo get_post_meta( get_the_ID(), 'stock-art-name', true ); ?> clipart "><?php echo get_post_meta( get_the_ID(), 'stock-art-name', true ); ?></a></h1>
  45.  
  46. </div>
  47. </div>
  48. <?php
  49. if($c == $bpr) :
  50. ?>
  51. <div class="clr"></div>
  52. <?php
  53. $c = 0;
  54. endif;
  55. ?>
  56. <?php
  57. $c++;
  58. endwhile;
  59. endif;
  60. ?>
  61. <div class="clr"></div>
  62.  
  63. <?php wp_pagenavi(); ?>
  64. </div>
  65. </div><!-- #content -->
  66. </div><!-- #container -->
  67.  
  68. <?php get_sidebar(); ?>
  69. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment