Advertisement
Guest User

Untitled

a guest
Mar 14th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.48 KB | None | 0 0
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Coraline
  5. * @since Coraline 1.0
  6. */
  7. ?>
  8.  
  9. <?php /* Display navigation to next/previous pages when applicable */ ?>
  10. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  11. <div id="nav-above" class="navigation">
  12. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'coraline' ) ); ?></div>
  13. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'coraline' ) ); ?></div>
  14. </div><!-- #nav-above -->
  15. <?php endif; ?>
  16.  
  17. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  18. <?php if ( ! have_posts() ) : ?>
  19. <div id="post-0" class="post error404 not-found">
  20. <h1 class="entry-title"><?php _e( 'Not Found', 'coraline' ); ?></h1>
  21. <div class="entry-content">
  22. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'coraline' ); ?></p>
  23. <?php get_search_form(); ?>
  24. </div><!-- .entry-content -->
  25. </div><!-- #post-0 -->
  26. <?php endif; ?>
  27.  
  28. <?php
  29. // Start the Loop.
  30. $options = coraline_get_theme_options(); while ( have_posts() ) : the_post(); ?>
  31.  
  32. <?php /* How to display posts in the Gallery category. */ ?>
  33.  
  34. <?php if ( ( isset( $options['gallery_category'] ) && '0' != $options['gallery_category'] && in_category( $options['gallery_category'] ) ) || 'gallery' == get_post_format( $post->ID ) ) : ?>
  35.  
  36. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  37. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  38.  
  39. <div class="entry-meta">
  40. <?php coraline_posted_on(); coraline_posted_by(); ?>
  41. </div><!-- .entry-meta -->
  42.  
  43. <div class="entry-content">
  44. <?php if ( post_password_required() ) : ?>
  45. <?php the_content(); ?>
  46. <?php else : ?>
  47. <?php
  48. $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
  49. if ( $images ) :
  50. $total_images = count( $images );
  51. $image = array_shift( $images );
  52. $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
  53. ?>
  54. <div class="gallery-thumb">
  55. <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
  56. </div><!-- .gallery-thumb -->
  57. <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'coraline' ),
  58. 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
  59. $total_images
  60. ); ?></em></p>
  61. <?php endif; ?>
  62. <?php the_excerpt(); ?>
  63. <?php endif; ?>
  64. </div><!-- .entry-content -->
  65.  
  66. <div class="entry-info">
  67. <span class="comments-link"><?php comments_popup_link( __( '&rarr; Leave a comment', 'coraline' ), __( '&rarr; 1 Comment', 'coraline' ), __( '&rarr; % Comments', 'coraline' ) ); ?></span>
  68.  
  69. <?php
  70. if ( isset( $options['gallery_category'] ) ) :
  71. $cat_slug = sanitize_title( $options['gallery_category'] );
  72. if ( in_category( $cat_slug ) ) :
  73. ?>
  74. <p><a href="<?php echo get_term_link( $cat_slug, 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'coraline' ); ?>"><?php _e( 'More Galleries', 'coraline' ); ?></a></p>
  75. <?php endif; endif; ?>
  76.  
  77. <p><?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?></p>
  78. </div><!-- .entry-info -->
  79. </div><!-- #post-## -->
  80.  
  81. <?php /* How to display posts in the asides category */ ?>
  82.  
  83. <?php elseif ( isset( $options['aside_category'] ) && '0' != $options['aside_category'] && in_category( $options['aside_category'] ) || 'aside' == get_post_format( $post->ID ) ) : ?>
  84. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  85.  
  86. <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
  87. <div class="entry-summary aside">
  88. <?php the_excerpt(); ?>
  89. </div><!-- .entry-summary -->
  90. <?php else : ?>
  91. <div class="entry-content aside">
  92. <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'coraline' ) ); ?>
  93. </div><!-- .entry-content -->
  94. <?php endif; ?>
  95.  
  96. <div class="entry-info">
  97. <p class="comments-link"><?php comments_popup_link( __( '&rarr; Leave a comment', 'coraline' ), __( '&rarr; 1 Comment', 'coraline' ), __( '&rarr; % Comments', 'coraline' ) ); ?></p>
  98. <p><?php coraline_posted_on(); coraline_posted_by(); ?></p>
  99. <?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?>
  100. </div><!-- .entry-info -->
  101. </div><!-- #post-## -->
  102.  
  103. <?php /* How to display all other posts. */ ?>
  104.  
  105. <?php else : ?>
  106. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  107. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  108.  
  109. <div class="entry-meta">
  110. <?php coraline_posted_on(); coraline_posted_by(); ?><span class="comments-link"><span class="meta-sep">|</span> <?php comments_popup_link( __( 'Leave a comment', 'coraline' ), __( '1 Comment', 'coraline' ), __( '% Comments', 'coraline' ) ); ?></span>
  111. </div><!-- .entry-meta -->
  112.  
  113. <?php if ( is_search() ) : // Display excerpts for search. ?>
  114. <div class="entry-summary">
  115. <?php the_excerpt(); ?>
  116. </div><!-- .entry-summary -->
  117. <?php else : ?>
  118. <div class="entry-content">
  119. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'coraline' ) ); ?>
  120. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'coraline' ), 'after' => '</div>' ) ); ?>
  121. </div><!-- .entry-content -->
  122. <?php endif; ?>
  123.  
  124. <div class="entry-info">
  125. <p class="comments-link"><?php comments_popup_link( __( '&rarr; Leave a comment', 'coraline' ), __( '&rarr; 1 Comment', 'coraline' ), __( '&rarr; % Comments', 'coraline' ) ); ?></p>
  126. <?php if ( count( get_the_category() ) ) : ?>
  127. <p class="cat-links">
  128. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'coraline' ), 'entry-info-prep entry-info-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  129. </p>
  130. <?php endif; ?>
  131. <?php
  132. $tags_list = get_the_tag_list( '', ', ' );
  133. if ( $tags_list ):
  134. ?>
  135. <p class="tag-links">
  136. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'coraline' ), 'entry-info-prep entry-info-prep-tag-links', $tags_list ); ?>
  137. </p>
  138. <?php endif; ?>
  139. <?php edit_post_link( __( 'Edit', 'coraline' ), '<p class="edit-link">', '</p>' ); ?>
  140. </div><!-- .entry-info -->
  141. </div><!-- #post-## -->
  142.  
  143. <?php comments_template( '', true ); ?>
  144.  
  145. <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
  146.  
  147. <?php endwhile; // End the loop. Whew. ?>
  148.  
  149. <?php /* Display navigation to next/previous pages when applicable */ ?>
  150. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  151. <div id="nav-below" class="navigation">
  152. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'coraline' ) ); ?></div>
  153. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'coraline' ) ); ?></div>
  154. </div><!-- #nav-below -->
  155. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement