Advertisement
ossmalta

Single-ad.php

Nov 20th, 2013
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.45 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <script type='text/javascript'>
  4. // <![CDATA[
  5. /* setup the form validation */
  6. jQuery(document).ready(function ($) {
  7.         $('#mainform').validate({
  8.                 errorClass: 'invalid'
  9.         });
  10. });
  11. // ]]>
  12. </script>
  13.  
  14.     <div class="row">
  15.         <?php colabs_breadcrumbs(array('before'=>'','after')); ?>
  16.     </div>
  17.  
  18.     <div class="row main-container">
  19.  
  20.         <div class="main-content col9">
  21.         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  22.             <article <?php post_class('entry'); ?>>
  23.            
  24.                 <?php colabsthemes_before_post_content(); ?>
  25.         <?php colabs_stats_update( $post->ID ); //records the page hit ?>
  26.                 <header class="entry-header">
  27.                     <h2><?php the_title(); ?></h2>
  28.                     <span class="price-tag"><?php if ( get_post_meta($post->ID, 'colabs_price', true) ) colabs_get_price_legacy($post->ID); else colabs_get_price($post->ID, 'colabs_price'); ?></span>
  29.            
  30.                 </header>
  31.  
  32.                 <div class="entry-images">
  33.                     <div class="entry-slides">
  34.                         <?php
  35.                         $custom_field = 'colabs_discount';
  36.                         $listing_discount = get_post_meta($post->ID,$custom_field,true);
  37.  
  38.                         // If ads is on sale
  39.                         if( !empty($listing_discount) ) : ?>
  40.                             <div class="sale-price"> <?php echo $listing_discount; ?>% <strong><?php _e('Sale','colabsthemes'); ?></strong>
  41.                             </div>
  42.                         <?php endif; ?>
  43.  
  44.                         <?php colabs_image('width=724&height=478&size=single-ad&link=img'); ?>
  45.                     </div><!-- .entry-slides -->
  46.  
  47.                     <div class="entry-thumbs clearfix">
  48.                         <?php
  49.                         $gallery_thumb = get_posts(  array(
  50.                             'post_type'         =>  'attachment',
  51.                             'posts_per_page'=> -1,
  52.                             'post_parent'       =>  $post->ID )
  53.                         );
  54.  
  55.                         if( $gallery_thumb && count($gallery_thumb) > 1 ) {
  56.                             foreach( $gallery_thumb as $thumb ) {
  57.                                 $thumb_src = wp_get_attachment_image_src( $thumb->ID, 'full' );
  58.                                 echo '<a href="'.$thumb_src[0].'" >';
  59.                                 echo colabs_image('link=img&width=75&height=75&src='.$thumb_src[0]);
  60.                                 echo '</a>';
  61.                             }
  62.                         } ?>
  63.                     </div>
  64.                    
  65.                 </div><!-- .entry-images -->
  66.  
  67.                 <div class="entry-content">
  68.  
  69.                         <?php the_content(); ?>
  70.                        
  71.                 </div>
  72.                 <!-- /.entry-content -->
  73.  
  74.                 <?php colabsthemes_after_post_content(); ?>
  75.  
  76.             </article>
  77.         <?php endwhile;endif;?>
  78.             <!-- /.entry -->
  79.                
  80.                 <?php comments_template( '/comments-ad.php' ); ?>
  81.  
  82.         </div>
  83.         <!-- .main-content -->
  84.  
  85.         <?php get_sidebar('ad'); ?>
  86.  
  87.     </div>
  88.     <!-- /.main-container -->
  89.  
  90. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement