PageRenderTime 39ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/loop.php

https://github.com/bchagas/natural
PHP | 49 lines | 42 code | 7 blank | 0 comment | 5 complexity | d4f1f7ba5aba9bf8469f763b43c752d9 MD5 | raw file
  1. <?php ?>
  2. <article class="primary-content">
  3. <?php $firstClass = 'first-post'; ?>
  4. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  5. <?php if ( ! have_posts() ) : ?>
  6. <article role="main" class="the-content">
  7. <h1><?php _e( '404 - I&#39;m sorry but the page can&#39;t be found' ); ?></h1>
  8. <p>Please try searching again or head back to the homepage.</p>
  9. </article>
  10. <?php endif; ?>
  11. <?php ?>
  12. <h1>
  13. <?php if ( is_day() ) : ?><?php printf( __( '<span>Daily Archive</span> %s' ), get_the_date() ); ?>
  14. <?php elseif ( is_month() ) : ?><?php printf( __( '<span>Monthly Archive</span> %s' ), get_the_date('F Y') ); ?>
  15. <?php elseif ( is_year() ) : ?><?php printf( __( '<span>Yearly Archive</span> %s' ), get_the_date('Y') ); ?>
  16. <?php elseif ( is_category() ) : ?><?php echo single_cat_title(); ?>
  17. <?php elseif ( is_search() ) : ?><?php printf( __( 'Search Results for: %s' ), '<span>' . get_search_query() . '</span>' ); ?>
  18. <?php elseif ( is_home() ) : ?>Latest Posts<?php else : ?>
  19. <?php endif; ?>
  20. </h1>
  21. <?php while ( have_posts() ) : the_post(); ?>
  22. <?php /* How to display standard posts and search results */ ?>
  23. <article class="article-archive <?php echo $firstClass; ?>" id="post-<?php the_ID(); ?>">
  24. <?php $firstClass = ""; ?>
  25. <?php ?>
  26. <div class="entry-summary">
  27. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail('full');?>
  28. <h2><?php the_title(); ?></h2></a>
  29. <?php the_excerpt(); ?>
  30. <p class="entry-meta"><time datetime="<?php the_time('l, F jS, Y') ?>" pubdate><?php the_time('l jS F Y') ?></time></p>
  31. </div>
  32. </article>
  33. <?php /*?><?php comments_template( '', true ); ?><?php */?>
  34. <?php endwhile; // End the loop. Whew. ?>
  35. <?php /* Display navigation to next/previous pages when applicable */ ?>
  36. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  37. <div class="navigation">
  38. <div class="nav-previous"><?php next_posts_link( __( 'Older posts' ) ); ?></div>
  39. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts' ) ); ?></div>
  40. </div><!-- #nav-below -->
  41. <?php endif; ?>
  42. </article>