Advertisement
duck__boy1981

loop-index.php

May 9th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. <?php $post_count = 1; ?>
  2.  
  3. <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
  4.  
  5.         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  6.                
  7.             <!-- Post image -->
  8.             <?php if(get_post_image()) : ?>
  9.                
  10.                 <div class="post_image">
  11.                     <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute('before=View post - '); ?>" class="linked_img">
  12.                         <?php post_image(); ?>
  13.                     </a>
  14.                 </div>
  15.                
  16.             <?php endif; ?>
  17.                
  18.             <div class="post_text">
  19.                
  20.                 <!-- Post Title -->
  21.                 <div class="post_title">
  22.                     <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute('before=View post - '); ?>">
  23.                         <?php the_title(); ?>
  24.                     </a></h2>
  25.                 </div>
  26.                    
  27.                 <!-- Post excerpt -->
  28.                 <div class="post_content">
  29.                     <?php the_excerpt(); ?>        
  30.                 </div>
  31.                    
  32.             </div>
  33.                
  34.             <div class="clear"></div>
  35.                
  36.         </div>
  37.            
  38.         <?php article_seperator($post_count) ?>
  39.         <?php $post_count++; ?>
  40.    
  41.     <?php endwhile; ?>
  42.        
  43.     <?php if(function_exists('show_page_numbers')) : show_page_numbers(); endif; ?>
  44.        
  45. <?php else : ?>
  46.    
  47.     <?php if(is_search()) : ?>
  48.         <div class="no-posts-found">
  49.        
  50.             <!-- Post Title -->
  51.             <div class="post_title">
  52.                 <h2>No results found</h2>
  53.             </div>
  54.                
  55.             <!-- Post content -->
  56.             <div class="post_content">
  57.                 <p>Sorry, we couldn't find any matching posts.</p>
  58.                 <p>Please try changing your search parameters and try again.</p>
  59.             </div>
  60.                
  61.         </div>
  62.     <?php endif; ?>
  63.                
  64. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement