PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/hero/template-blog.php

https://github.com/Bochet/festival_lgbt
PHP | 117 lines | 74 code | 43 blank | 0 comment | 9 complexity | f0284a8cb8fb5267440af2985c1b79b1 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <?php /* Template Name: Blog
  2. */ ?>
  3. <?php get_header(); ?>
  4. <div id="subhead_container">
  5. <div id="subhead_wrapper">
  6. <div id="subhead">
  7. <h1><?php if ( is_category() ) {
  8. single_cat_title();
  9. } elseif (is_tag() ) {
  10. echo (__( 'Archives for ', 'Hero' )); single_tag_title();
  11. } elseif (is_archive() ) {
  12. echo (__( 'Archives for ', 'Hero' )); single_month_title();
  13. } else {
  14. wp_title('',true);
  15. } ?></h1>
  16. </div>
  17. <div class="clear"></div>
  18. </div>
  19. <hr />
  20. </div>
  21. <!--content-->
  22. <div id="content_container">
  23. <div id="content">
  24. <div id="left-col">
  25. <?php
  26. global $more; $more = false; # some wordpress wtf logic
  27. $query_args = array(
  28. 'post_type' => 'post',
  29. 'paged' => $paged
  30. );
  31. $query_args = apply_filters( 'Hero_blog_template_query_args', $query_args );
  32. query_posts($query_args);
  33. if (have_posts()) : while (have_posts()) : the_post();
  34. $thumb_small = '';
  35. if(has_post_thumbnail(get_the_ID(), 'large'))
  36. {
  37. $image_id = get_post_thumbnail_id(get_the_ID());
  38. $thumb_small = wp_get_attachment_image_src($image_id, 'large', true);
  39. }
  40. ?>
  41. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  42. <div class="post-head">
  43. <h1><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'Hero' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
  44. </div><!--post-heading end-->
  45. <div class="meta-data">
  46. <?php Hero_posted_on(); ?> in <?php the_category(', '); ?> | <?php comments_popup_link( __( 'Leave a comment', 'Hero' ), __( '1 Comment', 'Hero' ), __( '% Comments', 'Hero' ) ); ?>
  47. </div><!--meta data end-->
  48. <div class="clear"></div>
  49. <div class="post-entry <?php if ($thumb_small <> '') {echo "timbg";} ?>">
  50. <?php if($thumb_small<>'') { ?>
  51. <a href="<?php the_permalink() ?>"><img src="<?php echo $thumb_small[0]; ?>" alt="<?php the_title(); ?>" /></a>
  52. <?php } ?>
  53. <?php the_content( __( '<span class="read-more">Read More</span>', 'Hero' ) ); ?>
  54. <div class="clear"></div>
  55. <?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'Hero' ), 'after' => '' ) ); ?>
  56. </div><!--post-entry end-->
  57. <?php comments_template( '', true ); ?>
  58. </div> <!--post end-->
  59. <?php endwhile; endif; ?>
  60. <!--pagination-->
  61. <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); }
  62. else { ?>
  63. <div class="navigation">
  64. <div class="alignleft"><?php next_posts_link( __( '&larr; Older posts', 'Hero' ) ); ?></div>
  65. <div class="alignright"><?php previous_posts_link( __( 'Newer posts &rarr;', 'Hero' ) ); ?></div>
  66. </div><?php } ?>
  67. </div> <!--left-col end-->
  68. <?php get_sidebar(); ?>
  69. </div>
  70. </div>
  71. <!--content end-->
  72. </div>
  73. <!--wrapper end-->
  74. <?php get_footer(); ?>