Advertisement
Guest User

single-products

a guest
Aug 3rd, 2014
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Products
  4. Author: Mehedi
  5. */
  6. get_header();
  7. ?>
  8. <div class="container td-page-wrap">
  9. <div class="row">
  10. <div class="span12">
  11. <div class="gdgt-wrap">
  12. <div class="container-fluid"
  13. <div id="content" class="row-fluid">
  14. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  15. <!--PRODUCT INTRO STARTS-->
  16. <div class="product-box-wrap">
  17. <?php the_post_thumbnail('medium', array('class' => 'product-img')); ?>
  18. <h2 class="product-title"><?php echo the_title();?></h2>
  19. <p class="product-info">Released on <?php echo the_time('d-m-Y');?> by <?php echo get_post_meta($post->ID, 'company', true); ?></p>
  20. <div class="product-description"><?php echo get_post_meta($post->ID, 'desc', true); ?></div>
  21. </div><br>
  22. <!--PRODUCT INTRO ENDS-->
  23. <!--PRODUCT INFO STARTS-->
  24. <div class="info-container">
  25. <!--PRODUCT OVERVIEW STARTS-->
  26. <div class="product-overview"><br>
  27. <h4 class="gdgt-title"><span>OVERVIEW</span></h4>
  28. <?php the_content();?>
  29. </div>
  30. <!--PRODUCT OVERVIEW ENDS-->
  31. <!--PRODUCT PRICE STARTS-->
  32. <div class="product-price">
  33. <br/><p>AVAILABLE FOR</p>
  34. <h1><?php echo get_post_meta($post->ID, 'price', true); ?></h1>
  35. <!--PRODUCT PRICE ENDS-->
  36. </div>
  37. <!--PRODUCT INFO ENDS-->
  38. <!--ABOUT PART STARTS-->
  39. <div class="about-part">
  40. <!--ADVERTISEMENT STARTS-->
  41. <div class="advertisment">
  42. <div class="td-visible-desktop">
  43. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  44. <!-- inlinelomabad -->
  45. <ins class="adsbygoogle"
  46. style="display:inline-block;width:728px;height:90px"
  47. data-ad-client="ca-pub-2231092370359736"
  48. data-ad-slot="8073637401"></ins>
  49. <script>
  50. (adsbygoogle = window.adsbygoogle || []).push({});
  51. </script>
  52. </div>
  53. <div class="td-visible-tablet-l">
  54. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  55. <!-- inlinelomabad -->
  56. <ins class="adsbygoogle"
  57. style="display:inline-block;width:728px;height:90px"
  58. data-ad-client="ca-pub-2231092370359736"
  59. data-ad-slot="8073637401"></ins>
  60. <script>
  61. (adsbygoogle = window.adsbygoogle || []).push({});
  62. </script>
  63. </div>
  64. <div class="td-visible-tablet-tp">
  65. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  66. <!-- PRODUCT -->
  67. <ins class="adsbygoogle"
  68. style="display:inline-block;width:468px;height:60px"
  69. data-ad-client="ca-pub-2231092370359736"
  70. data-ad-slot="8827267409"></ins>
  71. <script>
  72. (adsbygoogle = window.adsbygoogle || []).push({});
  73. </script>
  74. </div>
  75. <div class="td-visible-phone">
  76. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  77. <!-- mobile -->
  78. <ins class="adsbygoogle"
  79. style="display:inline-block;width:320px;height:50px"
  80. data-ad-client="ca-pub-2231092370359736"
  81. data-ad-slot="1304000600"></ins>
  82. <script>
  83. (adsbygoogle = window.adsbygoogle || []).push({});
  84. </script>
  85. </div>
  86. </div>
  87. <!--ADVERTISEMENT ENDS-->
  88. <!--PRODUCT SPECIFICATIONS STARTS-->
  89. <div id="basic-specs"><br>
  90. <h4 class="gdgt-title"><span>SPECIFICATIONS</span></h4>
  91. <?php
  92. $p_type= get_post_meta($post->ID, 'p_type', true);
  93. if ($p_type == "hardware") {
  94. echo "<table class='specs'>";
  95. echo"<tr class='odd'>";
  96. echo"<td class='specs'>Type</td>";
  97. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_type', true) . "</td>";
  98. echo"</tr>";
  99. echo"<tr class='odd'>";
  100. echo"<td class='specs'>Operating System</td>";
  101. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_os', true) . "</td>";
  102. echo"</tr>";
  103. echo"<tr class='odd'>";
  104. echo"<td class='specs'>Camera</td>";
  105. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_camera', true) . "</td>";
  106. echo"</tr>";
  107. echo"<tr>";
  108. echo"<td class='specs'>Screen Size</td>";
  109. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_screen', true) . "</td>";
  110. echo"</tr>";
  111. echo"<tr>";
  112. echo"<td class='specs'>Internal Storage</td>";
  113. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_storage', true) . "</td>";
  114. echo"</tr>";
  115. echo"<tr class='odd'>";
  116. echo"<td class='specs'>Talk Time</td>";
  117. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_talk_time', true) . "</td>";
  118. echo"</tr>";
  119. echo"<tr class='odd'>";
  120. echo"<td class='specs'>Dimensons</td>";
  121. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_dimensions', true) . "</td>";
  122. echo"</tr>";
  123. echo"<tr class='odd'>";
  124. echo"<td class='specs'>Weight</td>";
  125. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_weight', true) . "</td>";
  126. echo"</tr>";
  127. echo"<tr>";
  128. echo"<td class='specs'>Released</td>";
  129. echo"<td class='specs'>" . get_post_meta($post->ID, 'p_released', true) . "</td>";
  130. echo"</tr>";
  131. echo"<tr>";
  132. echo"<td class='specs'>Carriers</td>";
  133. echo"<td class='specs'>" . get_post_meta($post->ID, 'h_carriers', true) . "</td>";
  134. echo"</tr>";
  135. echo"</table>";
  136. }
  137. elseif ($p_type == "software") {
  138. echo "<table class='specs'>";
  139. echo"<tr>";
  140. echo"<td class='specs'>Software Type</td>";
  141. echo"<td class='specs'>" . get_post_meta($post->ID, 's_type', true) . "</td>";
  142. echo"</tr>";
  143. echo"<tr>";
  144. echo"<td class='specs'>Software Version</td>";
  145. echo"<td class='specs'>" . get_post_meta($post->ID, 's_type_version', true) . "</td>";
  146. echo"</tr>";
  147. echo"<tr>";
  148. echo"<td class='specs'>Released</td>";
  149. echo"<td class='specs'>" . get_post_meta($post->ID, 'p_released', true) . "</td>";
  150. echo"</tr>";
  151. echo"</table>";
  152. }
  153. ?>
  154. </div>
  155. <!--PRODUCT SPECIFICATIONS ENDS-->
  156. <!--ABOUT COMPANY STARTS-->
  157. <div class="about-company"><br>
  158. <div>
  159. <h4 class="gdgt-title"><span>ABOUT <?php echo get_post_meta($post->ID, 'company', true); ?></span></h4>
  160. </div>
  161. <p><?php echo get_post_meta($post->ID, 'about_company', true);?></p>
  162. </div>
  163. <!--ABOUT COMPANY ENDS-->
  164. <!--ABOUT PART ENDS-->
  165. <?php
  166. /** Admin Slug Function */
  167. function gdgt_post_slug() {
  168. $post_data = get_post($post->ID, ARRAY_A);
  169. $slug = $post_data['post_name'];
  170. return $slug;
  171. }
  172. ?>
  173. </div>
  174. <!--MORE INFO STARTS-->
  175. <div class="last">
  176. </div>
  177. <!--MORE INFO ENDS-->
  178. <!--NOT IMPORTANT STARTS-->
  179. <div class="post" id="post-<?php the_ID(); ?>"><div class="entry" style="clear:both;"></div></div>
  180. <?php endwhile; else: ?>
  181. <p>Sorry, no posts matched your criteria.</p>
  182. <?php endif; ?>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement