Advertisement
deliciousthemes

Line - Search form improved

Apr 29th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php
  4. //if there are results to show
  5. if (have_posts()) : ?>
  6.  
  7.     <section class="page-title">
  8.         <div class="two-third">
  9.             <h2><?php _e('Search Results for: ', 'line'); ?>"<?php the_search_query(); ?>"</h2>
  10.         </div>
  11.         <div class="one-third column-last">
  12.             <?php get_search_form( true ); ?>      
  13.         </div>
  14.         <div class="clear"></div>
  15.     </section> 
  16.  
  17.  
  18.     <div class="centered-wrapper">
  19.         <div id="posts">
  20.             <?php  
  21.                 if (have_posts()) {
  22.                     while (have_posts()) : the_post();
  23.                 ?>
  24.        
  25.                 <article class="post" id="post-<?php the_ID(); ?>">                    
  26.                     <h2 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  27.                     <div class="meta">
  28.                         <span class="post-date"><?php the_time(get_option('date_format')); ?></span>
  29.                         <span class="post-author"><?php the_author(); ?></span>
  30.                         <span class="post-comment"><?php comments_popup_link(__('No Comments &raquo;', 'line'), __('1 Comment &raquo;', 'line'), __('% Comments &raquo;', 'line')); ?></span>
  31.                     </div><!--end meta-->      
  32.                    
  33.                     <?php if ( has_post_thumbnail() ) { ?>     
  34.                         <div class="post-thumbnail">
  35.                             <a href="<?php the_permalink(); ?>">
  36.                                 <span class="item-on-hover"><span class="hover-link"></span></span>
  37.                                 <?php the_post_thumbnail('blog-thumb'); ?>
  38.                             </a>
  39.                         </div><!--end post-thumbnail-->                    
  40.                        
  41.                     <?php } ?>
  42.                     <div class="excerpt">                          
  43.                         <?php the_excerpt(); ?>
  44.                     </div>
  45.                
  46.                 </article>
  47.  
  48.                 <?php  endwhile;
  49.                 // if there are results, but not from the blog posts
  50.                 } else { ?>
  51.                     <article>
  52.                         <p><?php _e('Sorry, but the requested resource was not found on this site. Try another search:', 'line'); ?></p>
  53.                         <div class="no-page"><?php get_search_form(); ?></div>
  54.                     </article>
  55.            
  56.             <?php } ?>
  57.         </div>
  58.  
  59.         <?php get_sidebar(); ?>
  60.     </div>
  61.        
  62.  
  63.        
  64. <?php
  65. // if there are no search results
  66.  else : ?>
  67.  
  68.     <section class="page-title">
  69.         <div class="two-third">
  70.             <h2><?php _e('No Results for: ', 'line'); ?>"<?php the_search_query(); ?>"</h2>
  71.         </div>
  72.         <div class="one-third column-last">
  73.             <?php get_search_form( true ); ?>      
  74.         </div>
  75.         <div class="clear"></div>
  76.     </section> 
  77.    
  78.     <div class="centered-wrapper">
  79.         <div id="posts">
  80.             <article>
  81.                 <p><?php _e('Sorry, but the requested resource was not found on this site. Try another search.', 'line'); ?></p>
  82.             </article>
  83.         </div>
  84.        
  85.         <?php get_sidebar(); ?>
  86.     </div>
  87.  
  88. <?php endif; ?>
  89.  
  90. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement