Guest User

Untitled

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