Advertisement
msaari

SimpleMag search results

Feb 22nd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.79 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Search Results
  4.  *
  5.  * @package SimpleMag
  6.  * @since   SimpleMag 1.1
  7. **/
  8. get_header(); ?>
  9.  
  10.     <section id="content" role="main" class="clearfix anmtd">
  11.         <div class="wrapper">
  12.        
  13.             <header class="entry-header page-header">
  14.                 <?php printf( __( '<small>Search Results for:</small><br />', 'themetext' ) ); ?>
  15.                 <div class="page-title title-with-sep single-title">
  16.                     <h1 class="entry-title"><?php echo get_search_query(); ?></h1>
  17.                 </div>
  18.             </header><!-- .page-header -->
  19.            
  20.             <?php if ( is_active_sidebar( 'sidebar-1' ) ) : // If the sidebar has widgets ?>
  21.             <div class="grids">
  22.                 <div class="grid-8 column-1">
  23.             <?php endif; ?>
  24.  
  25. <?php if (function_exists('relevanssi_didyoumean')) { relevanssi_didyoumean(get_search_query(), "<p>Did you mean: ", "</p>", 5);
  26. }?>
  27.  
  28.                 <?php if (have_posts()) : ?>
  29.                    
  30.                     <div class="entries list-layout">
  31.                    
  32.                     <?php while ( have_posts() ) : the_post(); ?>
  33.                        
  34.                     <article id="post-<?php the_ID(); ?>" <?php post_class("clearfix"); ?>>
  35.                         <div class="post-item-inner">
  36.                    
  37.                         <?php // Check if an image exists.
  38.                             if ( has_post_thumbnail() || first_post_image() ) : ?>
  39.                             <figure class="entry-image">
  40.                                 <div class="entry-image-inner">
  41.  
  42.                                     <a href="<?php the_permalink(); ?>">
  43.                                         <?php
  44.                                         if ( has_post_thumbnail() ) {
  45.                                             the_post_thumbnail( 'rectangle-size' );
  46.                                         } elseif( first_post_image() ) { // Set the first image from the editor
  47.                                             echo '<img src="' . esc_url( first_post_image() ) . '" class="wp-post-image" />';
  48.                                         } ?>
  49.                                     </a>
  50.  
  51.                                     <?php
  52.                                     // Add icon to different post formats
  53.                                     if ( 'gallery' == get_post_format() ): // Gallery
  54.                                         echo '<i class="icomoon-camera-retro"></i>';
  55.                                     elseif ( 'video' == get_post_format() ): // Video
  56.                                         echo '<i class="icomoon-video-camera"></i>';
  57.                                     elseif ( 'audio' == get_post_format() ): // Audio
  58.                                         echo '<i class="icomoon-music"></i>';
  59.                                     endif;
  60.                                     ?>
  61.                                    
  62.                                 </div>
  63.                             </figure>
  64.                         <?php endif ?>
  65.                            
  66.                             <div class="entry-details">
  67.                                 <header class="entry-header">
  68.                                     <h2 class="entry-title">
  69.                                         <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
  70.                                     </h2>
  71.                                 </header>
  72.  
  73.                                 <div class="entry-summary">
  74.                                     <?php the_excerpt(); ?>
  75.                                 </div>
  76.                            
  77.                                 <footer class="entry-footer">
  78.                                     <a class="read-more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More', 'themetext' ); ?></a>
  79.                                 </footer>
  80.                             </div>
  81.                        
  82.                         </div>
  83.                     </article>
  84.                    
  85.                     <?php endwhile; ?>
  86.            
  87.                     </div>
  88.                    
  89.                 <?php else : ?>
  90.            
  91.                     <p class="message"><?php _e( 'Sorry, nothing found', 'themetext' ); ?></p>
  92.            
  93.                 <?php endif; ?>
  94.                    
  95.                 <?php the_posts_pagination( array(
  96.                     'mid_size' => 4,
  97.                     'prev_text' => __( '<i class="icomoon-arrow-left"></i>' ),
  98.                     'next_text' => __( '<i class="icomoon-arrow-right"></i>' ),
  99.                 ) ); ?>
  100.    
  101.             <?php if ( is_active_sidebar( 'sidebar-1' ) ) : // If the sidebar has widgets ?>
  102.                 </div><!-- .grid-8 -->
  103.            
  104.                 <?php get_sidebar(); ?>
  105.  
  106.             </div><!-- .grids -->
  107.             <?php endif; ?>
  108.        
  109.         </div>
  110.     </section>
  111.  
  112. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement