PageRenderTime 53ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

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

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