Advertisement
Guest User

archive.php

a guest
Oct 18th, 2012
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.66 KB | None | 0 0
  1. <?php
  2.  
  3. function render_content() {
  4. global $posts;
  5.  
  6. ?>
  7. <?php if ( have_posts() ) : ?>
  8. <div class="loop">
  9. <div class="loop-header">
  10. <h4 class="loop-title cat-page-title">
  11. <?php
  12. the_post();
  13.  
  14. if ( is_category() ) { // Category Archive
  15. $title = sprintf( __( 'Archive for %s', 'it-l10n-BuilderChild-Classen' ), single_cat_title( '', false ) );
  16. }
  17. else if ( is_tag() ) { // Tag Archive
  18. $title = sprintf( __( 'Archive for %s', 'it-l10n-BuilderChild-Classen' ), single_tag_title( '', false ) );
  19. }
  20. else if ( is_tax() ) { // Tag Archive
  21. $title = sprintf( __( 'Archive for %s', 'it-l10n-BuilderChild-Classen' ), builder_get_tax_term_title() );
  22. }
  23. else if ( is_day() || is_time() ) { // Day-Specific Archive
  24. $title = sprintf( __( 'Archive for %s', 'it-l10n-BuilderChild-Classen' ), get_the_time() );
  25. }
  26. else if ( is_month() ) { // Month-Specific Archive
  27. $title = sprintf( __( 'Archive for %s', 'it-l10n-BuilderChild-Classen' ), get_the_time( 'F Y' ) );
  28. }
  29. else if ( is_year() ) { // Year-Specific Archive
  30. $title = sprintf( __( 'Archive for %s', 'it-l10n-BuilderChild-Classen' ), get_the_time( 'Y' ) );
  31. }
  32. else if ( is_author() ) { // Author Archive
  33. $title = sprintf( __( 'Author Archive for %s', 'it-l10n-BuilderChild-Classen' ), get_the_author() );
  34. }
  35. else { // Default catch all just in case
  36. $title = __( 'Archive', 'it-l10n-BuilderChild-Classen' );
  37. }
  38.  
  39. if ( is_paged() )
  40. printf( '%s &ndash; Page %d', $title, get_query_var( 'paged' ) );
  41. else
  42. echo $title;
  43.  
  44. rewind_posts();
  45. ?>
  46. </h4>
  47. </div>
  48.  
  49. <div class="loop-content">
  50. <?php while ( have_posts() ) : // The Loop ?>
  51. <?php the_post(); ?>
  52.  
  53. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  54. <!-- title, meta, and date info -->
  55. <div class="entry-header clearfix">
  56. <div class="entry-meta leftmetabox">
  57. <?php if (has_post_thumbnail()) { ?>
  58. <div class="front-page-thumbnail">
  59. <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'front-page-thumbnail' ); ?></a>
  60. </div>
  61. <?php } ?>
  62. <div class="date">
  63. <span class="month"><?php the_time( 'n' ); ?></span> /
  64. <span class="day"><?php the_time( 'j' ); ?><span class="day-comma"> /</span></span>
  65. <span class="year"><?php the_time( 'y' ); ?></span><br />
  66. </div>
  67. <div class="author-meta">
  68. <?php printf( __( '%s', 'it-l10n-BuilderChild-Classen' ), '<span class="meta-author">' . builder_get_author_link() . '</span>' ); ?>
  69. <div class="author-gravatar">
  70. <?php echo get_avatar( get_the_author_meta( 'ID' ), '68' ); ?>
  71. </div>
  72. </div>
  73. <!-- categories, tags and comments -->
  74. <div class="entry-meta clearfix">
  75. <span class="categories"><?php printf( __( 'Categories<br /> %s', 'it-l10n-BuilderChild-Classen' ), get_the_category_list( '<br /> ' ) ); ?></span><br />
  76. <?php do_action( 'builder_comments_popup_link', '<span class="comments">', '</span>', __( ' %s <br />comments', 'it-l10n-BuilderChild-Classen' ), __( '0', 'it-l10n-BuilderChild-Classen' ), __( '1', 'it-l10n-BuilderChild-Classen' ), __( '%', 'it-l10n-BuilderChild-Classen' ) ); ?>
  77. </div>
  78. </div>
  79.  
  80.  
  81. <h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
  82.  
  83. <!-- "Read More" link -->
  84. <div class="entry-content">
  85. <?php the_content( __( 'Read More&rarr;', 'it-l10n-BuilderChild-Classen' ) ); ?>
  86. <?php wp_link_pages( array( 'before' => '<p class="entry-utility"><strong>' . __( 'Pages:', 'it-l10n-BuilderChild-Classen' ) . '</strong> ', 'after' => '</p>', 'next_or_number' => 'number' ) ); ?>
  87. </div>
  88. </div>
  89. </div>
  90.  
  91. <?php comments_template(); // include comments template ?>
  92. <?php endwhile; // end of one post ?>
  93. </div><!-- end of loop-content div -->
  94.  
  95. <div class="loop-footer">
  96. <!-- Previous/Next page navigation -->
  97. <div class="loop-utility clearfix">
  98. <div class="alignleft"><?php previous_posts_link( __( '&laquo; Previous Page', 'it-l10n-BuilderChild-Classen' ) ); ?></div>
  99. <div class="alignright"><?php next_posts_link( __( 'Next Page &raquo;', 'it-l10n-BuilderChild-Classen' ) ); ?></div>
  100. </div>
  101. </div>
  102.  
  103. </div><!-- end of loop div -->
  104.  
  105. <?php else : // do not delete ?>
  106. <?php do_action( 'builder_template_show_not_found' ); ?>
  107. <?php endif; // do not delete ?>
  108. <?php
  109.  
  110. }
  111.  
  112. add_action( 'builder_layout_engine_render_content', 'render_content' );
  113.  
  114. do_action( 'builder_layout_engine_render', basename( __FILE__ ) );
  115.  
  116.  
  117. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement