Advertisement
Guest User

Untitled

a guest
Aug 16th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. <?php
  2. /**
  3. * The loop that displays posts.
  4. *
  5. * The loop displays the posts and the post content. See
  6. * http://codex.wordpress.org/The_Loop to understand it and
  7. * http://codex.wordpress.org/Template_Tags to understand
  8. * the tags used in it.
  9. *
  10. * This can be overridden in child themes with loop.php or
  11. * loop-template.php, where 'template' is the loop context
  12. * requested by a template. For example, loop-index.php would
  13. * be used if it exists and we ask for the loop with:
  14. * <code>get_template_part( 'loop', 'index' );</code>
  15. *
  16. * @package WordPress
  17. * @subpackage Revolution
  18. * @since Revolution 1.0
  19. */
  20. ?>
  21.  
  22. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  23. <?php if ( ! have_posts() ) : ?>
  24. <article id="post-0" class="post error404 not-found">
  25. <h1 class="posttitle"><?php _e( 'Not Found', 'templatesquare' ); ?></h1>
  26. <div class="entry">
  27. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'templatesquare' ); ?></p>
  28. <?php get_search_form(); ?>
  29. </div>
  30. </article>
  31. <?php endif; ?>
  32.  
  33.  
  34. <?php while ( have_posts() ) : the_post(); ?>
  35.  
  36. <?php /* How to display all posts. */ ?>
  37. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  38.  
  39.  
  40. <div class="entry-content">
  41.  
  42. <?php
  43. $custom = get_post_custom($post->ID);
  44. $cf_thumb = (isset($custom["thumb"][0]))? $custom["thumb"][0] : "";
  45.  
  46. if($cf_thumb!=""){
  47. $thumb = '<div class="postimg"><img src='. $cf_thumb .' alt="" class="scale-with-grid"/></div>';
  48. }elseif(has_post_thumbnail($post->ID) ){
  49. $thumb = '<div class="postimg">'.get_the_post_thumbnail($post->ID, 'post-blog', array('alt' => '', 'class' => 'scale-with-grid')).'</div>';
  50. }else{
  51. $thumb ="";
  52. }
  53. ?>
  54.  
  55.  
  56. <?php
  57. if(!is_search()){
  58. echo $thumb;
  59. }
  60. ?>
  61.  
  62. <h2 class="posttitle">
  63. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'templatesquare' ), the_title_attribute( 'echo=0' ) ); ?>" data-rel="bookmark"><?php the_title(); ?></a>
  64. </h2>
  65. <?php the_content(__('Continue Reading &rarr;', 'templatesquare')); ?>
  66. </div>
  67. <div class="clear"></div>
  68.  
  69. </article><!-- end post -->
  70.  
  71. <?php comments_template( '', true ); ?>
  72.  
  73. <?php endwhile; // End the loop. Whew. ?>
  74.  
  75.  
  76. <div class="pagenavi">
  77. <?php paginate();?>
  78. </div>
  79.  
  80. <?php wp_reset_query();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement