Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.39 KB | None | 0 0
  1. <?php
  2. global $woo_options;
  3. get_header();
  4.  
  5. // Determine whether or not the homepage sidebar is enabled (enabled by default).
  6. // Also determine the various differences in logic if the sidebar is enabled/disabled.
  7. $has_sidebar = true;
  8. $content_css_class = ' home-sidebar';
  9. $main_css_class = 'col-left';
  10. $mini_features_count = 2;
  11. $portfolio_count = 2;
  12.  
  13. if ( is_array( $woo_options ) && @$woo_options['woo_home_sidebar'] == 'false' ) {
  14. $has_sidebar = false;
  15. $content_css_class = '';
  16. $main_css_class = 'col-full';
  17. $mini_features_count = 3;
  18. $portfolio_count = 4;
  19. }
  20. ?>
  21.  
  22. <?php
  23. if ( @$woo_options['woo_mini_features'] == 'true' ) {
  24.  
  25. $featured_title = __('Why Are People Choosing Us?', 'woothemes');
  26. $mini_features_number = 3;
  27.  
  28. if ( is_array( $woo_options ) && @$woo_options['woo_sub_featured_title'] ) {
  29. $featured_title = $woo_options[ 'woo_sub_featured_title' ];
  30. }
  31.  
  32. if ( is_array( $woo_options ) && @$woo_options['woo_mini_features_number'] ) {
  33. $mini_features_number = intval( $woo_options[ 'woo_mini_features_number' ] );
  34. }
  35. ?>
  36. <!-- Mini Features -->
  37. <div id="sub-featured" class="<?php echo $main_css_class; ?> section">
  38. <h2 class="section-title"><?php echo stripslashes( $featured_title ); ?></h2>
  39.  
  40. <?php query_posts('post_type=infobox&order=ASC&posts_per_page='.$mini_features_number); ?>
  41. <?php if (have_posts()) { $count = 0; while (have_posts()) { the_post(); $count++; ?>
  42.  
  43. <?php
  44. $excerpt = stripslashes(get_post_meta($post->ID, 'mini_excerpt', true));
  45. $button = get_post_meta($post->ID, 'mini_readmore', true);
  46. $post_class = 'post block';
  47.  
  48. if ( $count % $mini_features_count == 0 ) { $post_class .= ' last'; }
  49. ?>
  50.  
  51. <div <?php post_class( $post_class ); ?>>
  52.  
  53. <a href="<?php echo $button; ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php woo_image('key=mini-image&width=300&height=100&class=thumbnail aligncenter&link=img'); ?></a>
  54.  
  55. <h3 class="title"><a href="<?php echo $button; ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
  56. <?php if ( $excerpt ) { ?>
  57. <div class="entry">
  58. <?php echo $excerpt; ?>
  59. </div>
  60. <?php } ?>
  61.  
  62. </div><!-- /.post -->
  63. <?php if ( $count % $mini_features_count == 0 ) { echo '<div class="fix"></div>'; } ?>
  64. <?php
  65. } // End WHILE Loop
  66. } else {
  67. ?>
  68. <div class="post">
  69. <p><?php _e('Sorry, no posts matched your criteria.', 'woothemes'); ?></p>
  70. </div><!-- /.post -->
  71. <?php } // End IF Statement ?>
  72. </div><!-- /#mini-features -->
  73.  
  74. <?php if ( $woo_options[ 'woo_slider' ] == 'true' && is_home() ) get_template_part( 'includes/featured' ); ?>
  75.  
  76. <div id="content" class="col-full<?php echo $content_css_class; ?>">
  77. <div id="main" class="<?php echo $main_css_class; ?>">
  78. <?php if ( @$woo_options['woo_home_posts'] == 'false' ) { ?>
  79.  
  80. <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('post_type=post&paged=$paged'); ?>
  81.  
  82. <?php } // End IF Statement ?>
  83.  
  84.  
  85. <!-- Portfolio -->
  86. <?php
  87. if ($woo_options[ 'woo_portfolio' ] == 'true' ) {
  88.  
  89. $featured_title = __('Our Latest Work', 'woothemes');
  90. $portfolio_number = 4;
  91.  
  92. if ( is_array( $woo_options ) && @$woo_options['woo_portfolio_title'] ) {
  93. $featured_title = $woo_options[ 'woo_portfolio_title' ];
  94. }
  95.  
  96. if ( is_array( $woo_options ) && @$woo_options['woo_portfolio_number'] ) {
  97. $portfolio_number = intval( $woo_options[ 'woo_portfolio_number' ] );
  98. }
  99. ?>
  100. <div id="portfolio" class="<?php echo $main_css_class; ?> section">
  101. <h2 class="section-title"><?php echo stripslashes( $featured_title ); ?></h2>
  102. <?php query_posts( 'post_type=portfolio&posts_per_page='.$portfolio_number ); ?>
  103. <?php
  104. if ( have_posts() ) { $count = 0;
  105. while ( have_posts() ) { the_post(); $count++;
  106.  
  107. $post_class = 'post block';
  108. if ( $count % $portfolio_count == 0 ) { $post_class .= ' last'; }
  109.  
  110. $excerpt = woo_text_trim( get_the_excerpt(), '12');
  111. ?>
  112. <div <?php post_class( $post_class ); ?>>
  113. <div class="portfolio-img">
  114. <a href="<?php the_permalink(); ?>" class="portfolio-link" title="<?php the_title_attribute(); ?>"><?php woo_image('key=portfolio-image&width=214&height=119&class=thumbnail aligncenter&link=img'); ?></a>
  115. </div>
  116.  
  117. <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
  118. <?php if ( $excerpt ) { ?>
  119. <div class="entry">
  120. <?php echo $excerpt; ?>
  121. </div>
  122. <?php } ?>
  123. </div>
  124. <?php if ( $count % $portfolio_count == 0 ) { echo '<div class="fix"></div>'; } ?>
  125. <?php
  126. } // End WHILE Loop
  127. } else {
  128. ?>
  129. <div class="post">
  130. <p><?php _e( 'Sorry, no posts matched your criteria.', 'woothemes' ); ?></p>
  131. </div><!-- /.post -->
  132. <?php } // End IF Statement ?>
  133. <div class="fix"></div>
  134. </div>
  135. <?php } // End IF Statement ?>
  136. <!-- /Portfolio -->
  137.  
  138. <!-- Testimonials -->
  139. <?php if ( $woo_options[ 'woo_testimonials' ] == 'true' ) { ?>
  140. <div id="testimonials" class="<?php if ($woo_options['woo_home_sidebar'] == "false" ) echo 'col-full '; ?>section">
  141. <h2 class="section-title"><?php if ( $woo_options[ 'woo_info_quote_title' ] ) echo stripslashes( $woo_options[ 'woo_info_quote_title' ] ); else _e('What Our Clients Say', 'woothemes'); ?></h2>
  142. <div class="quote-icon"></div>
  143. <div class="quotes">
  144.  
  145. <?php query_posts( 'post_type=testimonial&order=ASC&posts_per_page=20' ); ?>
  146. <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); ?>
  147. <?php
  148. $author = get_post_meta($post->ID, 'testimonial_author', $single = true);
  149. $url = get_post_meta($post->ID, 'testimonial_url', $single = true);
  150. ?>
  151. <div class="quote">
  152. <blockquote><?php the_content(); ?></blockquote>
  153. <?php if ( $author ) { ?><cite>&ndash; <?php echo $author; ?> <?php if ( $url ) { ?> - <a href="<?php echo $url; ?>"><?php echo $url; ?></a><?php } ?></cite><?php } // End IF Statement ?>
  154. </div>
  155. <?php
  156. } // End WHILE Loop
  157. } // End IF Statement
  158. ?>
  159.  
  160. </div>
  161. </div>
  162. <?php } // End IF Statement ?>
  163. <!-- /Testimonials -->
  164.  
  165. <?php } else { //End Home Posts IF Statement ?>
  166.  
  167. <?php if ( get_query_var('paged') ) $paged = get_query_var('paged'); elseif ( get_query_var('page') ) $paged = get_query_var('page'); else $paged = 1; ?>
  168. <?php query_posts("post_type=post&paged=$paged"); ?>
  169. <?php if (have_posts()) : $count = 0; while (have_posts()) : the_post(); $count++; ?>
  170.  
  171. <!-- Post Starts -->
  172. <div <?php post_class(); ?>>
  173.  
  174. <?php if ( $woo_options[ 'woo_post_content' ] != "content" ) woo_image('width='.$woo_options[ 'woo_thumb_w' ].'&height='.$woo_options[ 'woo_thumb_h' ].'&class=thumbnail '.$woo_options[ 'woo_thumb_align' ]); ?>
  175.  
  176. <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
  177.  
  178. <?php woo_post_meta(); ?>
  179.  
  180. <div class="entry">
  181. <?php global $more; $more = 0; ?>
  182. <?php if ( $woo_options[ 'woo_post_content' ] == "content" ) the_content(__('Read More...', 'woothemes')); else the_excerpt(); ?>
  183. </div>
  184. <div class="fix"></div>
  185.  
  186. <div class="post-more">
  187. <span class="comments"><?php comments_popup_link(__('Leave a comment', 'woothemes'), __('1 Comment', 'woothemes'), __('% Comments', 'woothemes')); ?></span>
  188. <?php if ( $woo_options[ 'woo_post_content' ] == "excerpt" ) { ?>
  189. <span class="post-more-sep">&bull;</span>
  190. <span class="read-more"><a href="<?php the_permalink() ?>" title="<?php _e('Continue Reading &rarr;','woothemes'); ?>"><?php _e('Continue Reading &rarr;','woothemes'); ?></a></span>
  191. <?php } ?>
  192. </div>
  193.  
  194. </div><!-- /.post -->
  195.  
  196. <?php endwhile; else: ?>
  197. <div <?php post_class(); ?>>
  198. <p><?php _e('Sorry, no posts matched your criteria.', 'woothemes') ?></p>
  199. </div><!-- /.post -->
  200. <?php endif; ?>
  201.  
  202. <?php woo_pagenav(); ?>
  203. <?php wp_reset_query(); ?>
  204.  
  205. <?php } ?>
  206. </div><!-- /#main -->
  207.  
  208. <?php if ( @$woo_options['woo_home_sidebar'] == 'true' ) { get_sidebar(); } ?>
  209.  
  210. </div><!-- /#content -->
  211.  
  212. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement