Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Template Name: Page for work
  4.  *
  5.  */
  6. ?>
  7.  
  8. <?php get_header(); ?>
  9.  
  10.         <div id="container">
  11.             <div id="content">
  12. <?php
  13. $page = 1;
  14. $type = 'work';
  15. $args=array(
  16.     'post_type' => $type,
  17.     'post_status' => 'publish',
  18.     'paged' => $page,
  19.     'posts_per_page' => 9,
  20. );
  21.  
  22. $temp = $wp_query;  // assign orginal query to temp variable for later use
  23. $wp_query = new WP_Query($args);
  24. ?>
  25.  
  26. <button class="prev"><<</button>
  27. <button class="next">>></button>
  28.  
  29. <div id="workCarousel">
  30.  
  31.     <ul id="workGrid">
  32.        
  33.            
  34.                                        
  35.  
  36. <li class="workitems">
  37. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  38.  
  39. <div class="workitem">
  40.    
  41.     <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  42.        
  43.         <?php
  44.         if ( has_post_thumbnail() ) {
  45.             the_post_thumbnail( 'single-work-thumbnail' );
  46.         } else {
  47.             echo ("<img width='330' height='240' src='test.jpg'>");
  48.         }
  49.         ?>
  50.        
  51.         <span class="info"><?php the_title(); ?></span></a>
  52. </div>
  53.  
  54.  
  55. <?php endwhile; // end of the loop. ?>
  56.  
  57. </li>
  58.         </ul> <!-- #workGrid -->
  59.    
  60. </div> <!-- #workCarousel -->
  61.  
  62.  
  63.             </div><!-- #content -->
  64.        </div><!-- #container -->
  65.  
  66. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement