Advertisement
Guest User

search.php

a guest
Aug 28th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php
  4.  
  5. $options = get_option('sf_neighborhood_options');
  6. $default_page_heading_bg_alt = $options['default_page_heading_bg_alt'];
  7. $sidebar_config = $options['archive_sidebar_config'];
  8. $left_sidebar = $options['archive_sidebar_left'];
  9. $right_sidebar = $options['archive_sidebar_right'];
  10. $blog_type = $options['archive_display_type'];
  11.  
  12. $page_wrap_class = '';
  13. if ($sidebar_config == "left-sidebar") {
  14. $page_wrap_class = 'has-left-sidebar has-one-sidebar row';
  15. } else if ($sidebar_config == "right-sidebar") {
  16. $page_wrap_class = 'has-right-sidebar has-one-sidebar row';
  17. } else if ($sidebar_config == "both-sidebars") {
  18. $page_wrap_class = 'has-both-sidebars';
  19. } else {
  20. $page_wrap_class = 'has-no-sidebar';
  21. }
  22.  
  23. $list_class = $item_class = '';
  24.  
  25. if ($blog_type == "mini") {
  26. if ($sidebar_config == "both-sidebars") {
  27. $item_class = "span6";
  28. } else if ($sidebar_config == "right-sidebar" || $sidebar_config == "left-sidebar") {
  29. $item_class = "span8";
  30. } else {
  31. $item_class = "span12";
  32. }
  33. } else if ($blog_type == "masonry") {
  34. if ($sidebar_config == "both-sidebars") {
  35. $item_class = "span3";
  36. } else {
  37. $item_class = "span4";
  38. }
  39. } else {
  40. if ($sidebar_config == "both-sidebars") {
  41. $standard_post_width = "span5";
  42. $item_class = "span6";
  43. } else if ($sidebar_config == "right-sidebar" || $sidebar_config == "left-sidebar") {
  44. $standard_post_width = "span6";
  45. $item_class = "span8";
  46. } else {
  47. $standard_post_width = "span10";
  48. $item_class = "span12";
  49. }
  50. }
  51.  
  52. if ($blog_type == "masonry") {
  53. $list_class .= 'masonry-items';
  54. $item_class .= ' recent-post';
  55. } else if ($blog_type == "mini") {
  56. $list_class .= 'mini-items';
  57. } else {
  58. $list_class .= 'standard-items';
  59. }
  60.  
  61.  
  62.  
  63. if ($blog_type == "masonry") {
  64. global $include_isotope;
  65. $include_isotope = true;
  66. }
  67.  
  68. global $has_blog;
  69. $has_blog = true;
  70.  
  71. sf_set_sidebar_global($sidebar_config);
  72.  
  73. ?>
  74.  
  75. <div class="row">
  76. <div class="page-heading span12 clearfix alt-bg <?php echo $default_page_heading_bg_alt; ?>">
  77. <div class="heading-text">
  78. <?php $allsearch = new WP_Query("s=$s&showposts=-1"); $key = esc_html($s, 1); $count = $allsearch->post_count; _e('', "swiftframework"); wp_reset_query(); ?>
  79. <?php if ($count == 1) : ?>
  80. <?php printf(__('<h1>%1$s result for <span>%2$s</span></h1>', 'swiftframework'), $count, $key ); ?>
  81. <?php else : ?>
  82. <?php printf(__('<h1>%1$s results for <span>%2$s</span></h1>', 'swiftframework'), $count, $key ); ?>
  83. <?php endif; ?>
  84. </div>
  85. <?php
  86. // BREADCRUMBS
  87. echo sf_breadcrumbs();
  88. ?>
  89. </div>
  90. </div>
  91.  
  92. <div class="inner-page-wrap <?php echo $page_wrap_class; ?> clearfix">
  93.  
  94. <!-- OPEN page -->
  95. <?php if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") { ?>
  96. <div class="archive-page span8 clearfix">
  97. <?php } else if ($sidebar_config == "both-sidebars") { ?>
  98. <div class="archive-page row clearfix">
  99. <?php } else { ?>
  100. <div class="archive-page clearfix">
  101. <?php } ?>
  102.  
  103. <?php if ($sidebar_config == "both-sidebars") { ?>
  104.  
  105. <div class="page-content span6 clearfix">
  106.  
  107. <?php if(have_posts()) : ?>
  108.  
  109. <div class="blog-wrap">
  110.  
  111. <!-- OPEN .blog-items -->
  112. <ul class="blog-items row <?php echo $list_class; ?> clearfix">
  113.  
  114. <?php while (have_posts()) : the_post(); ?>
  115.  
  116. <?php
  117. $post_format = get_post_format($post->ID);
  118. if ( $post_format == "" ) {
  119. $post_format = 'standard';
  120. }
  121. ?>
  122. <li class="blog-item <?php echo $item_class; ?> format-<?php echo $post_format; ?>">
  123. <?php echo sf_get_post_item($post->ID, $blog_type); ?>
  124. </li>
  125.  
  126. <?php endwhile; ?>
  127.  
  128. <!-- CLOSE .blog-items -->
  129. </ul>
  130.  
  131. </div>
  132.  
  133. <?php else: ?>
  134.  
  135. <h3><?php _e("Sorry, there are no posts to display.", "swiftframework"); ?></h3>
  136.  
  137. <?php endif; ?>
  138.  
  139. <div class="pagination-wrap">
  140. <?php echo pagenavi($wp_query); ?>
  141. </div>
  142.  
  143. </div>
  144.  
  145. <aside class="sidebar left-sidebar span3">
  146. <?php dynamic_sidebar($left_sidebar); ?>
  147. </aside>
  148.  
  149. <?php } else { ?>
  150.  
  151. <div class="page-content clearfix">
  152.  
  153. <?php if(have_posts()) : ?>
  154.  
  155. <div class="blog-wrap">
  156.  
  157. <!-- OPEN .blog-items -->
  158. <ul class="blog-items row <?php echo $list_class; ?> clearfix">
  159.  
  160. <?php while (have_posts()) : the_post(); ?>
  161.  
  162. <?php
  163. $post_format = get_post_format($post->ID);
  164. if ( $post_format == "" ) {
  165. $post_format = 'standard';
  166. }
  167. ?>
  168. <li class="blog-item <?php echo $item_class; ?> format-<?php echo $post_format; ?>">
  169. <?php echo sf_get_post_item($post->ID, $blog_type); ?>
  170. </li>
  171.  
  172. <?php endwhile; ?>
  173.  
  174. <!-- CLOSE .blog-items -->
  175. </ul>
  176.  
  177. </div>
  178.  
  179. <?php else: ?>
  180.  
  181. <h3><?php _e("Sorry, there are no posts to display.", "swiftframework"); ?></h3>
  182.  
  183. <?php endif; ?>
  184.  
  185. <div class="pagination-wrap">
  186. <?php echo pagenavi($wp_query); ?>
  187. </div>
  188.  
  189. </div>
  190.  
  191. <?php } ?>
  192.  
  193. <!-- CLOSE page -->
  194. </div>
  195.  
  196. <?php if ($sidebar_config == "left-sidebar") { ?>
  197.  
  198. <aside class="sidebar left-sidebar span4">
  199. <?php dynamic_sidebar($left_sidebar); ?>
  200. </aside>
  201.  
  202. <?php } else if ($sidebar_config == "right-sidebar") { ?>
  203.  
  204. <aside class="sidebar right-sidebar span4">
  205. <?php dynamic_sidebar($right_sidebar); ?>
  206. </aside>
  207.  
  208. <?php } else if ($sidebar_config == "both-sidebars") { ?>
  209.  
  210.  
  211. <aside class="sidebar right-sidebar span3">
  212. <?php dynamic_sidebar($right_sidebar); ?>
  213. </aside>
  214.  
  215. <?php } ?>
  216.  
  217. </div>
  218.  
  219. <!--// WordPress Hook //-->
  220. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement