Advertisement
Beee

whls content-wheels.php

Dec 5th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. <?php
  2.     $stylesheetdir  = get_bloginfo('stylesheet_directory');
  3.     $stylesheetdir2 = get_stylesheet_directory();
  4.     $thumb                  = get_the_post_thumbnail();
  5.     $category           = get_the_category();
  6.     $colour                 = get_post_meta($post->ID, 'colour', true);
  7.     $contactpatch       = get_post_meta($post->ID, 'contactpatch', true);
  8.     $dia                        = get_post_meta($post->ID, 'diameter', true);
  9.     $duro                   = get_post_meta($post->ID, 'durometer', true);
  10.     $formula                = get_post_meta($post->ID, 'formula', true);
  11.     $hub                        = get_post_meta($post->ID, 'hub', true);
  12.     $lip                        = get_post_meta($post->ID, 'lip', true);
  13.     $position           = get_post_meta($post->ID, 'position', true);
  14.     $surface                = get_post_meta($post->ID, 'finish', true);
  15.     $weight                 = get_post_meta($post->ID, 'weight', true);
  16.     $width                  = get_post_meta($post->ID, 'width', true);
  17.  
  18.     if ( !is_single() ) {
  19.         global $counter;
  20.         $counter++;
  21.         if ( is_sticky() ) { $sticky = 'sticky'; }
  22.         $postclasses = array(
  23.             'p'.$counter,
  24.             $sticky,
  25.         );
  26. ?>
  27.         <article <?php post_class( $postclasses ); ?>>
  28.       <?php
  29.         get_template_part('templates/wheel', 'image');
  30.       ?>
  31.           <?php // the_content(); ?>
  32.           <?php // wp_link_pages(array('before' => '<nav class="pagination">', 'after' => '</nav>')); ?>
  33.          
  34.         </article>
  35.        
  36. <?php } else { // if single
  37.  
  38.         if ( is_sticky() ) { $sticky = 'sticky'; }
  39.         $postclasses = array(
  40.             $sticky,
  41.         );
  42. ?>
  43.         <article <?php post_class( $postclasses ); ?>>
  44.     <header>
  45.       <h1 class="entry-title"><?php echo $category[0]->name; echo ' '; the_title(); echo ' ('.$dia.'mm/'.$duro.'a)'; ?></h1>
  46.       <?php // get_template_part('templates/entry-meta'); ?>
  47.     </header>
  48.     <div class="entry-content">
  49. <?php
  50.         if ($thumb) {
  51.             $src_med            = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium', false, '' );
  52.             $src_large      = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large', false, '' );
  53.             $image_med      = $src_med[0];
  54.             $image_large    = $src_large[0];
  55.         }   else {
  56.             $image_med = $stylesheetdir.'/assets/img/no-image.png';
  57.         }
  58. ?>         
  59.       <?php
  60.         get_template_part('templates/wheel', 'image');
  61.       ?>
  62.             <div class="clear"></div>
  63.             <hr />
  64.             <p>Room for optional promotional video</p>
  65.             <p>Room for optional promotional banner</p>
  66.  
  67.       <?php // the_content(); ?>
  68.     </div>
  69.     <footer>
  70.       <?php wp_link_pages(array('before' => '<nav class="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>')); ?>
  71.     </footer>
  72.     <?php // comments_template('/templates/comments.php'); ?>
  73.   </article>
  74.  
  75. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement