Advertisement
ed-fusionary

Untitled

Jan 28th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.69 KB | None | 0 0
  1. <?php get_header(); ?>
  2.     <?php
  3.     $sidebar_exists = false;
  4.     $container_class = '';
  5.     $timeline_icon_class = '';
  6.     $post_class = '';
  7.     $content_class = '';
  8.     $sidebar_exists = false;
  9.     $sidebar_left = '';
  10.     $double_sidebars = false;
  11.  
  12.     $sidebar_1 = $smof_data['search_sidebar'];
  13.     $sidebar_2 = $smof_data['search_sidebar_2'];
  14.     if( $sidebar_1 != 'None' && $sidebar_2 != 'None' ) {
  15.         $double_sidebars = true;
  16.     }
  17.  
  18.     if( $sidebar_1 != 'None' ) {
  19.         $sidebar_exists = false;
  20.     } else {
  21.         $sidebar_exists = false;
  22.     }
  23.  
  24.     if( ! $sidebar_exists ) {
  25.         $content_css = 'width:100%';
  26.         $sidebar_css = 'display:none';
  27.         $content_class= 'full-width';
  28.         $sidebar_exists = false;
  29.     } elseif($smof_data['search_sidebar_position'] == 'Left') {
  30.         $content_css = 'float:right;';
  31.         $sidebar_css = 'float:left;';
  32.         $sidebar_left = 1;
  33.     } elseif($smof_data['search_sidebar_position'] == 'Right') {
  34.         $content_css = 'float:left;';
  35.         $sidebar_css = 'float:right;';
  36.         $sidebar_left = 2;
  37.     }
  38.  
  39.     if($double_sidebars == true) {
  40.         $content_css = 'float:left;';
  41.         $sidebar_css = 'float:left;';
  42.         $sidebar_2_css = 'float:left;';
  43.     } else {
  44.         $sidebar_left = 1;
  45.     }
  46.  
  47.     if($smof_data['search_layout'] == 'Large Alternate') {
  48.         $post_class = 'large-alternate';
  49.     } elseif($smof_data['search_layout'] == 'Medium Alternate') {
  50.         $post_class = 'medium-alternate';
  51.     } elseif($smof_data['search_layout'] == 'Medium') {
  52.         $post_class = 'medium';
  53.     } elseif($smof_data['search_layout'] == 'Grid') {
  54.         $post_class = 'grid-post';
  55.         $container_class = sprintf( 'grid-layout grid-layout-%s isotope', $smof_data['blog_grid_columns'] );
  56.     } elseif($smof_data['search_layout'] == 'Timeline') {
  57.         $post_class = 'timeline-post';
  58.         $container_class = 'timeline-layout isotope';
  59.         if($smof_data['search_sidebar'] != 'None') {
  60.             $container_class = 'timeline-layout timeline-sidebar-layout isotope';
  61.             $timeline_icon_class = ' has-sidebar';
  62.         }
  63.     }
  64.     ?>
  65.     <div id="content" class="<?php echo $content_class; ?>" style="<?php echo $content_css; ?>">
  66.         <?php
  67.         if($smof_data['search_results_per_page']) {
  68.             $page_num = $paged;
  69.             if ($pagenum='') { $pagenum = 1; }
  70.                 global $query_string;
  71.             //              query_posts($query_string.'&posts_per_page='.$smof_data['search_results_per_page'].'&paged='.$page_num);
  72.         } ?>
  73.  
  74.         <?php if ( have_posts() && strlen( trim(get_search_query()) ) != 0 ) : ?>
  75.         <div class="search-page-search-form">
  76.             <h2><?php echo __('Need a new search?', 'Avada'); ?></h2>
  77.             <p><?php echo __('If you didn\'t find what you were looking for, try a new search!', 'Avada'); ?></p>
  78.             <form class="searchform seach-form" role="search" method="get" action="<?php echo home_url( '/' ); ?>">
  79.                 <div class="search-table">
  80.                     <div class="search-field">
  81.                         <input type="text" value="" name="s" class="s" placeholder="<?php _e( 'Search ...', 'Avada' ); ?>"/>
  82.                     </div>
  83.                     <div class="search-button">
  84.                         <input type="submit" class="searchsubmit" value="&#xf002;" />
  85.                     </div>
  86.                 </div>
  87.             </form>
  88.         </div>
  89.         <?php if($smof_data['search_layout'] == 'Timeline'): ?>
  90.         <div class="timeline-icon<?php echo $timeline_icon_class; ?>"><i class="fusionicon-bubbles"></i></div>
  91.             <?php endif; ?>
  92.             <div id="posts-container" class="<?php echo $container_class; ?> clearfix">
  93.                 <?php
  94.                 $post_count = 1;
  95.  
  96.                 $prev_post_timestamp = null;
  97.                 $prev_post_month = null;
  98.                 $prev_post_year = null;
  99.                 $first_timeline_loop = false;
  100.  
  101.                 while(have_posts()): the_post();
  102.                     $post_timestamp = strtotime($post->post_date);
  103.                     $post_month = date('n', $post_timestamp);
  104.                     $post_year = get_the_date('o');
  105.                     $current_date = get_the_date('o-n');
  106.                 ?>
  107.                 <?php if($smof_data['search_layout'] == 'Timeline'): ?>
  108.                 <?php if($prev_post_month != $post_month || $prev_post_year != $post_year): ?>
  109.                     <div class="timeline-date"><h3 class="timeline-title"><?php echo get_the_date($smof_data['timeline_date_format']); ?></h3></div>
  110.                 <?php endif; ?>
  111.                 <?php endif; ?>
  112.                 <?php $thumb_class = ''; ?>
  113.                 <?php if(get_post_meta(get_the_ID(), 'pyre_video', true) ): ?>
  114.                 <?php $thumb_class = ' has-post-thumbnail'; ?>
  115.                 <?php endif; ?>
  116.                 <div id="post-<?php the_ID(); ?>" <?php post_class('post ' . $post_class.getClassAlign($post_count) . $thumb_class . ' clearfix'); ?>>
  117.                     <div class="post-wrapper">
  118.                         <?php if($smof_data['search_layout'] == 'Medium Alternate'): ?>
  119.                         <?php echo avada_post_date_and_format_box(); ?>
  120.                         <?php endif; ?>
  121.                         <?php
  122.                         if(!$smof_data['search_featured_images']):
  123.                             get_template_part('new-slideshow');
  124.                         endif;
  125.                         ?>
  126.                         <div class="post-content-container">
  127.                             <?php if($smof_data['search_layout'] == 'Timeline'): ?>
  128.                             <div class="timeline-circle"></div>
  129.                             <div class="timeline-arrow"></div>
  130.                             <?php endif; ?>
  131.                             <?php if($smof_data['search_layout'] != 'Large Alternate' && $smof_data['search_layout'] != 'Medium Alternate' && $smof_data['search_layout'] != 'Grid'  && $smof_data['search_layout'] != 'Timeline'): ?>
  132.                             <h2<?php if( ! $smof_data['disable_date_rich_snippet_pages'] ) { echo ' class="entry-title"'; } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  133.                             <?php endif; ?>
  134.                             <?php if($smof_data['search_layout'] == 'Large Alternate'): ?>
  135.                             <?php echo avada_post_date_and_format_box(); ?>
  136.                             <?php endif; ?>
  137.                             <div class="post-content">
  138.                                 <?php if($smof_data['search_layout'] == 'Large Alternate' || $smof_data['search_layout'] == 'Medium Alternate'  || $smof_data['search_layout'] == 'Grid' || $smof_data['search_layout'] == 'Timeline'): ?>
  139.                                 <h2 class="post-title<?php if( ! $smof_data['disable_date_rich_snippet_pages'] ) { echo ' entry-title'; } ?>"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  140.                                 <?php
  141.                                 if($smof_data['search_layout'] == 'Grid' || $smof_data['search_layout'] == 'Timeline') {
  142.                                     echo avada_render_post_metadata( 'grid_timeline' );
  143.                                 } else {
  144.                                     echo avada_render_post_metadata( 'alternate' );
  145.                                 }
  146.                                 ?>
  147.                                 <?php endif; ?>
  148.                                 <?php if( ( ! $smof_data['post_meta'] && $smof_data['excerpt_length_blog'] == '0' ) || ( $smof_data['post_meta_author'] && $smof_data['post_meta_date'] && $smof_data['post_meta_cats'] && $smof_data['post_meta_tags'] && $smof_data['post_meta_comments'] && $smof_data['post_meta_read'] && $smof_data['excerpt_length_blog'] == '0' ) ): ?>
  149.                                 <?php if( ! $smof_data['post_meta'] ): ?>
  150.                                 <div class="no-content-sep"></div>
  151.                                 <?php endif; ?>
  152.                                 <?php else: ?>
  153.                                 <div class="content-sep"></div>
  154.                                 <?php endif; ?>
  155.                                 <?php if(!$smof_data['search_excerpt']): ?>
  156.                                 <?php
  157.                                 if(get_post_type( get_the_ID() ) != 'page') {
  158.  
  159.                                     $stripped_content = tf_content( $smof_data['excerpt_length_blog'], $smof_data['strip_html_excerpt'] );
  160.                                     // echo $stripped_content;
  161.                                 } else {
  162.                                     $stripped_content = tf_content( 55, $smof_data['strip_html_excerpt'] );
  163.  
  164.                                     // echo $stripped_content;
  165.  
  166.                                 }
  167.                                 echo fm_get_meta_description();
  168.                                 ?>
  169.                                 <?php endif; ?>
  170.                                 <?php if($smof_data['post_meta'] && !$smof_data['post_meta_tags'] && ($smof_data['search_layout'] == 'Large' || $smof_data['search_layout'] == 'Medium' || $smof_data['search_layout'] == 'Grid' || $smof_data['search_layout'] == 'Timeline')): ?>
  171.                                 <div class="meta-tags bottom"><?php the_tags( ); ?></div>
  172.                                 <?php endif; ?>
  173.                             </div>
  174.                             <div class="fusion-clearfix"></div>
  175.                             <?php if($smof_data['post_meta']): ?>
  176.                                 <div class="meta-info meta-info--searchResults">
  177.                                 <?php if($smof_data['search_layout'] == 'Grid' || $smof_data['search_layout'] == 'Timeline'): ?>
  178.                                     <?php if($smof_data['search_layout'] != 'Large Alternate' && $smof_data['search_layout'] != 'Medium Alternate'): ?>
  179.                                         <div class="alignleft">
  180.                                             <?php if(!$smof_data['post_meta_read']): ?><a href="<?php the_permalink(); ?>" class="read-more"><?php echo __('Read More', 'Avada'); ?></a><?php endif; ?>
  181.                                         </div>
  182.                                     <?php endif; ?>
  183.                                     <div class="alignright">
  184.                                         <?php if(!$smof_data['post_meta_comments']): ?><?php comments_popup_link('<i class="fusionicon-bubbles"></i>&nbsp;'.__('0', 'Avada'), '<i class="fusionicon-bubbles"></i>&nbsp;'.__('1', 'Avada'), '<i class="fusionicon-bubbles"></i>&nbsp;'.'%'); ?><?php endif; ?>
  185.                                     </div>
  186.                                 <?php else: ?>
  187.                                     <?php if($smof_data['search_layout'] != 'Large Alternate' && $smof_data['search_layout'] != 'Medium Alternate'): ?>
  188.                                         <?php // echo avada_render_post_metadata( 'standard' ); ?>
  189.                                     <?php endif; ?>
  190.                                     <?php
  191.                                         $link = get_permalink();
  192.                                         $link = str_replace('http://', '', $link);
  193.                                     ?>
  194.                                     <?php if(!$smof_data['post_meta_read']): ?><a href="<?php the_permalink(); ?>"><?php echo $link; ?></a><?php endif; ?>
  195.  
  196.                                 <?php endif; ?>
  197.                                 </div>
  198.                             <?php endif; ?>
  199.                         </div>
  200.                     </div>
  201.                 </div>
  202.                 <?php
  203.                 $prev_post_timestamp = $post_timestamp;
  204.                 $prev_post_month = $post_month;
  205.                 $prev_post_year = $post_year;
  206.                 $post_count++;
  207.                 endwhile;
  208.                 ?>
  209.             </div>
  210.             <?php themefusion_pagination($pages = '', $range = 2); ?>
  211.         <?php wp_reset_query(); ?>
  212.     <?php else: ?>
  213.     <div class="post-content">
  214.         <div class="fusion-title title">
  215.             <h2 class="title-heading-left"><?php echo __('Couldn\'t find what you\'re looking for!', 'Avada'); ?></h2><div class="title-sep-container"><div class="title-sep sep-double"></div></div>
  216.         </div>
  217.         <div class="error_page">
  218.             <div class="fusion-one-third one_third fusion-column">
  219.                 <h1 class="oops <?php echo ($sidebar_css != 'display:none') ? 'sidebar-oops' : ''; ?>"><?php echo __('Oops!', 'Avada'); ?></h1>
  220.             </div>
  221.             <div class="fusion-one-third one_third fusion-column useful_links">
  222.                 <h3><?php echo __('Here are some useful links:', 'Avada'); ?></h3>
  223.                 <?php $iconcolor = strtolower($smof_data['checklist_icons_color']); ?>
  224.  
  225.                 <style type='text/css'>
  226.                     .post-content #checklist-1 li:before{color:<?php echo $iconcolor; ?> !important;}
  227.                     .rtl .post-content #checklist-1 li:after{color:<?php echo $iconcolor; ?> !important;}
  228.                 </style>
  229.  
  230.                 <?php wp_nav_menu(array('theme_location' => '404_pages', 'depth' => 1, 'container' => false, 'menu_id' => 'checklist-1', 'menu_class' => 'list-icon circle-yes list-icon-arrow')); ?>
  231.             </div>
  232.             <div class="fusion-one-third one_third fusion-column last">
  233.                 <h3><?php echo __('Try again!', 'Avada'); ?></a></h3>
  234.                 <p><?php echo __('If you want to rephrase your query, here is your chance:', 'Avada'); ?></p>
  235.                 <form class="searchform seach-form" role="search" method="get" action="<?php echo home_url( '/' ); ?>">
  236.                     <div class="search-table">
  237.                         <div class="search-field">
  238.                             <input type="text" value="" name="s" class="s" placeholder="<?php _e( 'Search ...', 'Avada' ); ?>"/>
  239.                         </div>
  240.                         <div class="search-button">
  241.                             <input type="submit" class="searchsubmit" value="&#xf002;" />
  242.                         </div>
  243.                     </div>
  244.                 </form>
  245.             </div>
  246.         </div>
  247.     </div>
  248.     <?php endif; ?>
  249.     </div>
  250.     <?php if( $sidebar_exists == true ): ?>
  251.     <?php wp_reset_query(); ?>
  252.     <div id="sidebar" class="sidebar" style="<?php echo $sidebar_css; ?>">
  253.         <?php
  254.         if($sidebar_left == 1) {
  255.             generated_dynamic_sidebar($sidebar_1);
  256.         }
  257.         if($sidebar_left == 2) {
  258.             generated_dynamic_sidebar_2($sidebar_2);
  259.         }
  260.         ?>
  261.     </div>
  262.     <?php if( $double_sidebars == true ): ?>
  263.     <div id="sidebar-2" class="sidebar" style="<?php echo $sidebar_2_css; ?>">
  264.         <?php
  265.         if($sidebar_left == 1) {
  266.             generated_dynamic_sidebar_2($sidebar_2);
  267.         }
  268.         if($sidebar_left == 2) {
  269.             generated_dynamic_sidebar($sidebar_1);
  270.         }
  271.         ?>
  272.     </div>
  273.     <?php endif; ?>
  274.     <?php endif; ?>
  275. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement