Advertisement
Guest User

Trying to find the relevant part of the loop

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