Guest User

Untitled

a guest
Feb 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.60 KB | None | 0 0
  1. <?php /*
  2. Template Name: Home Page - first layout
  3. */ ?>
  4.  
  5. <?php get_header(); ?>
  6.  
  7. <div id="content">
  8.  
  9. <?php while (have_posts ()) : the_post(); ?>
  10.  
  11. <div <?php post_class(); ?>>
  12.  
  13. <?php the_content(); ?>
  14.  
  15. <?php the_more(); ?>
  16.  
  17. <div class="linebreak"></div>
  18.  
  19. </div><!-- end post -->
  20.  
  21. <?php endwhile; ?>
  22.  
  23. <?php if (get_option_tree('folios', '')) : ?>
  24.  
  25. <div class="recent-posts">
  26.  
  27. <?php
  28. query_posts(array('post_type' => 'portfolio', 'post__in' => get_option_tree('folios', '', false, true), 'showposts' => -1));
  29. global $more;
  30. $more = 0;
  31.  
  32. if (have_posts ()) : while (have_posts ()) : the_post(); ?>
  33.  
  34.  
  35. <div class="portfolio-item home">
  36.  
  37. <div class="thumbnail">
  38.  
  39. <?php
  40. $images = get_post_meta(get_the_ID(), 'rw_screenshot', false);
  41. $video_lightbox = get_post_meta(get_the_ID(), 'rw_pvideo_lightbox', true);
  42. $lo = wp_get_attachment_image_src(get_post_meta(get_the_ID(), 'rw_screenshot', true), 'home-portfolio-3col');
  43. $lo_lb = wp_get_attachment_image_src(get_post_meta(get_the_ID(), 'rw_screenshot', true), 'Large');
  44. $thb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'home-portfolio-3col', false, '' );
  45.  
  46.  
  47. if ($video_lightbox != NULL && $lo != NULL) {
  48. echo '<a href="'.the_permalink().'"><img src="' . $lo[0] . '" /><span>&nbsp;</span></a>';
  49. } else if ($video_lightbox != NULL && $lo == NULL) {
  50. echo '<a href="'.the_permalink().'"><img src="'.$thb[0].'" /><span>&nbsp;</span></a>';
  51. } else if ($video_lightbox == NULL && $lo != NULL) {
  52. echo '<a href="'.the_permalink().'"><img src="' . $lo[0] . '" /><span>&nbsp;</span></a>';
  53. }
  54. ?>
  55. </div>
  56.  
  57. <div class="excerpt">
  58.  
  59. <h3>
  60.  
  61. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
  62.  
  63.  
  64. <?php echo content(6); ?>
  65.  
  66. </div>
  67.  
  68. <?php the_more(); ?>
  69.  
  70. </div><!-- end portfolio-item -->
  71.  
  72.  
  73. <?php endwhile; ?>
  74.  
  75. </div>
  76.  
  77. <div class="linebreak"></div>
  78. <?php endif;endif;
  79. wp_reset_query();
  80. ?>
  81.  
  82. <?php if (get_option_tree('recent_pages', '')) : ?>
  83.  
  84. <div class="recent-pages">
  85.  
  86. <?php
  87. query_posts(array('post_type' => 'page', 'post__in' => get_option_tree('recent_pages', '', false, true), 'showposts' => -1));
  88. global $more;
  89. $more = 0;
  90. ?>
  91.  
  92. <?php $count = 0; ?>
  93.  
  94. <?php $i = 0;
  95. if (have_posts ()) : while (have_posts ()) : the_post(); ?>
  96.  
  97. <?php if ($count % 3 == 2) {
  98. ?>
  99. <div class="home-item last">
  100.  
  101. <h3>
  102.  
  103. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
  104. <?php } else {
  105. ?>
  106. <div class="home-item">
  107.  
  108. <h3>
  109.  
  110. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
  111. <?php } ?>
  112.  
  113. <?php
  114. $images = get_post_meta(get_the_ID(), 'rw_icon', false);
  115. foreach ($images as $att) {
  116. $src = wp_get_attachment_image_src($att, 'minimal');
  117. $src = $src[0];
  118. if (isset($src)) {
  119. ?>
  120.  
  121. <div class="icon">
  122.  
  123. <img src="<?php echo $src ?>" alt="<?php the_title(); ?>" />
  124.  
  125. </div>
  126. <?php
  127. $i++;
  128. if ($i > 0)
  129. break;
  130. }
  131. }
  132. ?>
  133.  
  134. <?php $meta = get_post_meta(get_the_ID(), 'rw_fidescription', true); { ?>
  135.  
  136. <p><?php echo $meta; ?></p>
  137.  
  138. <?php } ?>
  139.  
  140. <a class="gotopage" href="<?php the_permalink(); ?>">>></a>
  141.  
  142. </div>
  143. <?php if ($count % 3 == 2) {
  144. ?>
  145. <div class="linebreak nospace"></div>
  146.  
  147. <?php } ?>
  148.  
  149. <?php
  150. $count++;
  151. $i++;
  152. endwhile; ?>
  153.  
  154.  
  155.  
  156. </div>
  157.  
  158. <div class="linebreak"></div>
  159. <?php endif;
  160. endif;
  161. wp_reset_query();
  162. ?>
  163.  
  164.  
  165. <?php if (get_option_tree('recent_posts', '')) : ?>
  166.  
  167. <div class="recent-posts">
  168.  
  169. <?php
  170. query_posts(array('post_type' => 'post', 'post__in' => get_option_tree('recent_posts', '', false, true), 'showposts' => -1));
  171. global $more;
  172. $more = 0;
  173. ?>
  174.  
  175. <?php $count = 0; ?>
  176.  
  177. <?php $i = 0;
  178. if (have_posts ()) : while (have_posts ()) : the_post(); ?>
  179.  
  180. <?php if ($count % 3 == 2) {
  181. ?>
  182. <div class="home-item last">
  183. <?php } else {
  184. ?>
  185. <div class="home-item">
  186. <?php } ?>
  187.  
  188. <?php if (has_post_thumbnail ()) : ?>
  189.  
  190. <div class="thumbnail link">
  191.  
  192. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  193.  
  194. <?php the_post_thumbnail('home-posts'); ?>
  195.  
  196. <span class="ov">&nbsp;</span>
  197.  
  198. </a>
  199.  
  200. </div>
  201.  
  202. <?php endif; ?> <div class="post-excerpt">
  203.  
  204. <h3>
  205.  
  206. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?>
  207.  
  208. </a>
  209.  
  210. </h3>
  211.  
  212. <p class="date"><?php the_time('M j, Y'); ?></p>
  213.  
  214.  
  215. <?php echo content(14); ?>
  216.  
  217. <?php the_more(); ?>
  218. </div>
  219.  
  220. </div>
  221.  
  222. <?php
  223. $count++;
  224. $i++;
  225. endwhile; ?>
  226.  
  227. </div>
  228. <?php endif;
  229. endif;
  230. ?></div>
  231.  
  232. </div><!-- end content -->
  233.  
  234. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment