PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/blog/wp-content/themes/traction/archive.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 58 lines | 53 code | 1 blank | 4 comment | 11 complexity | ead5319ac893162c0ff3e8c7d355a3bc MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Traction
  5. */
  6. get_header(); ?>
  7. <div id="main-top">
  8. <?php /* If this is a category archive */ if ( is_category() ) { ?>
  9. <h4><?php printf( __( 'Posts from the &#8220;%s&#8221; Category', 'traction' ), single_cat_title( '', false ) ); ?></h4>
  10. <?php /* If this is a tag archive */ } elseif ( is_tag() ) { ?>
  11. <h4><?php printf( __( 'Posts tagged &#8220;%s&#8221;', 'traction' ), single_tag_title( '', false ) ); ?></h4>
  12. <?php /* If this is a daily archive */ } elseif ( is_day() ) { ?>
  13. <h4><?php _e( 'Archive for', 'traction' ); ?> <?php the_time( __( 'F jS, Y', 'traction' ) ); ?></h4>
  14. <?php /* If this is a monthly archive */ } elseif ( is_month() ) { ?>
  15. <h4><?php _e( 'Archive for', 'traction' ); ?> <?php the_time( __( 'F, Y', 'traction' ) ); ?></h4>
  16. <?php /* If this is a yearly archive */ } elseif ( is_year() ) { ?>
  17. <h4><?php _e( 'Archive for', 'traction' ); ?> <?php the_time( __( 'Y', 'traction' ) ); ?></h4>
  18. <?php /* If this is an author archive */ } elseif ( is_author() ) { if ( isset( $_GET['author_name'] ) ) $current_author = get_userdatabylogin( $author_name ); else $current_author = get_userdata( intval( $author) );?>
  19. <h4><?php printf( __( 'Posts by %s', 'traction' ), $current_author->display_name ); ?></h4>
  20. <?php /* If this is a paged archive */ } elseif ( isset( $_GET['paged'] ) && !empty( $_GET['paged'] ) ) { ?>
  21. <h4><?php _e( 'Blog Archives', 'traction' ); ?></h4>
  22. <?php } ?>
  23. <?php get_template_part( 'subscribe' ); ?>
  24. </div>
  25. <div id="main" class="clear">
  26. <div id="content">
  27. <?php if (have_posts() ) : ?>
  28. <?php while (have_posts() ) : the_post(); ?>
  29. <?php $has_thumb = false; ?>
  30. <div id="post-<?php the_ID(); ?>" <?php post_class( 'clear' ); ?>>
  31. <div class="date">
  32. <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
  33. <div class="day"><?php the_time( __( 'j' ) ); ?></div>
  34. <div class="month"><?php the_time( __( 'M', 'traction' ) ); ?></div>
  35. </a>
  36. </div>
  37. <?php if ( has_post_thumbnail() && ( $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'index-thumb' ) ) && $image[1] >= '175' ) : ?>
  38. <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'index-thumb', array( 'class' => 'index-post-thm alignleft border' ) ); ?></a>
  39. <?php $has_thumb = true; ?>
  40. <?php endif; ?>
  41. <div class="entry<?php if ( ! $has_thumb ) echo ' nothumb'; ?>">
  42. <h2 class="title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  43. <?php the_content( traction_read_more() ); ?>
  44. <?php edit_post_link( __( 'Edit', 'traction' ) ); ?>
  45. <?php wp_link_pages(); ?>
  46. </div><!--end entry-->
  47. </div><!--end post-->
  48. <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
  49. <div class="navigation index">
  50. <div class="alignleft"><?php next_posts_link( __( '&laquo; Older Entries', 'traction' ) ); ?></div>
  51. <div class="alignright"><?php previous_posts_link( __( 'Newer Entries &raquo;', 'traction' ) ); ?></div>
  52. </div><!--end navigation-->
  53. <?php else : ?>
  54. <?php endif; ?>
  55. </div><!--end content-->
  56. <?php get_sidebar(); ?>
  57. <?php get_footer(); ?>