Advertisement
alchymyth

loop 1full/3col

Jun 21st, 2011
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.22 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package WordPress
  4.  * @subpackage Coraline
  5.  * @since Coraline 1.0
  6.  */
  7. ?>
  8.  
  9. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  10. <?php if ( ! have_posts() ) : ?>
  11.     <div id="post-0" class="post error404 not-found">
  12.         <h1 class="entry-title"><?php _e( 'Not Found', 'coraline' ); ?></h1>
  13.         <div class="entry-content">
  14.             <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'coraline' ); ?></p>
  15.             <?php get_search_form(); ?>
  16.         </div><!-- .entry-content -->
  17.     </div><!-- #post-0 -->
  18. <?php endif; ?>
  19.  
  20. <?php
  21.     // Start the Loop.
  22.     $options = get_option( 'coraline_theme_options' ); while ( have_posts() ) : the_post(); ?>
  23.  
  24. <?php /* How to display posts in the Gallery category. */ ?>
  25.  
  26.     <?php if ( isset( $options['gallery_category'] ) && '0' != $options['gallery_category'] && in_category( $options['gallery_category'] ) ) : ?>
  27.  
  28.         <div id="post-<?php the_ID(); ?>" <?php post_class( 'category-gallery' ); ?>>
  29.             <h2 class="excerpt-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>
  30.  
  31.             <div class="entry-meta">
  32.                 <?php coraline_posted_on(); ?>
  33.             </div><!-- .entry-meta -->
  34.  
  35.              <div class="entry-content">
  36.             <?php if ( post_password_required() ) : ?>
  37.                      <?php the_content(); ?>      
  38.  
  39. <?php else : ?>
  40.                 <?php
  41.                     $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
  42.                     if ( $images ) :
  43.                         $total_images = count( $images );
  44.                         $image = array_shift( $images );
  45.                         $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
  46.                 ?>
  47.                         <div class="gallery-thumb">
  48.                             <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
  49.                         </div><!-- .gallery-thumb -->
  50.                         <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'coraline' ),
  51.                                 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
  52.                                 $total_images
  53.                             ); ?></em></p>
  54.                 <?php endif; ?>
  55.                     <?php the_excerpt(); ?>
  56.             <?php endif; ?>
  57.  
  58.             </div><!-- .entry-content -->
  59.  
  60.             <div class="entry-info">
  61.  <span class="comments-link"><?php comments_popup_link( __( '&rarr; Leave a comment', 'coraline' ), __( '&rarr; 1 Comment', 'coraline' ), __( '&rarr; % Comments', 'coraline' ) ); ?></span>
  62.                 <p><a href="<?php echo get_term_link( $options['gallery_category'], 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'coraline' ); ?>"><?php _e( 'More Galleries', 'coraline' ); ?></a></p>
  63.                 <p><?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?></p>
  64.             </div><!-- .entry-info -->
  65.  </div><!-- #post-## -->
  66.  
  67. <?php /* How to display posts in the asides category */ ?>
  68.  
  69.     <?php elseif ( isset( $options['aside_category'] ) && '0' != $options['aside_category'] && in_category( $options['aside_category'] ) ) : ?>
  70.         <div id="post-<?php the_ID(); ?>" <?php post_class( 'category-asides' ); ?>>
  71.  
  72.         <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
  73.             <div class="entry-summary aside">
  74.                 <?php the_excerpt(); ?>
  75.             </div><!-- .entry-summary -->
  76.         <?php else : ?>
  77.             <div class="entry-content aside">
  78.                 <?php the_content( __( 'Read more <span class="meta-nav">&rarr;</span>', 'coraline' ) ); ?>
  79.             </div><!-- .entry-content -->
  80.          
  81. <?php endif; ?>
  82.  
  83.             <div class="entry-info">
  84.                <p class="comments-link"><?php comments_popup_link( __( '&rarr; Leave a comment', 'coraline' ), __( '&rarr; 1 Comment', 'coraline' ), __( '&rarr; % Comments', 'coraline' ) ); ?></p>
  85.                 <p><?php coraline_posted_on(); ?></p>
  86.                 <?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?>
  87.             </div><!-- .entry-info -->
  88.   </div><!-- #post-## -->
  89.  
  90. <?php /* How to display all other posts. */ ?>
  91.  
  92.     <?php else : ?>
  93.  
  94. <?php if( $halfstyle = '' ) : //////the first post
  95. /*
  96. alles fuer volle breite, grosses bild, etc.;
  97. das folgende ist nur beispiel und nicht getestet;
  98. besonders die css classes muessen neu ausgedacht werden;
  99. the_post_thumbnail('large') groesse so muss definiert werden;
  100. */
  101. ?>
  102.         <div id="post-<?php the_ID(); ?>" <?php post_class('full-width'); ?>>
  103.  
  104. <div class="large-featured-image"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_post_thumbnail ('large'); ?></a>
  105. </div><!-- .large-featured-image -->
  106.  
  107.            <div class="excerpt">
  108.                 <?php the_content( __( 'Read more <span class="meta-nav">&rarr;</span>', 'coraline' ) ); ?>
  109.                 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'coraline' ), 'after' => '</div>' ) ); ?>
  110.             </div><!-- .excerpt -->
  111.  
  112. </div><!-- #post-## -->
  113.  
  114. <?php $halfstyle = 'right-half'; //vorbereitung fuer die drei kleinen posts
  115. //end of first post
  116. ?>
  117. <?php else : //////wenn nicht der erste post ?>
  118.  
  119. <?php $halfstyle = ($halfstyle == '') ? 'left-half' : (($halfstyle == 'left-half') ? 'middle-half' : (($halfstyle == 'middle-half') ? 'right-half' : 'left-half' )); ?>
  120.  
  121.         <div id="post-<?php the_ID(); ?>" <?php post_class($halfstyle); ?>>
  122.  
  123. <div class="featured-image"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_post_thumbnail (); ?></a>
  124. </div><!-- .featured-image -->
  125.  
  126. <h2 class="excerpt-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  127.  
  128.     <?php if ( is_search() ) : // Display excerpts for search. ?>
  129.             <div class="entry-summary">
  130.                 <?php the_excerpt(); ?>
  131.             </div><!-- .entry-summary -->
  132.     <?php else : ?>
  133.            <div class="excerpt">
  134.                 <?php the_excerpt( __( 'Read more <span class="meta-nav">&rarr;</span>', 'coraline' ) ); ?>
  135.                 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'coraline' ), 'after' => '</div>' ) ); ?>
  136.             </div><!-- .excerpt -->
  137.  
  138.     <?php endif; ?>
  139.  
  140.  </div><!-- #post-## -->
  141.  
  142. <?php endif; //////ende des bereichs 'wenn nicht der erste post'
  143.  
  144.  <?php comments_template( '', true ); ?>
  145.  
  146.     <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
  147.    
  148. <?php endwhile; // End the loop. Whew. ?>
  149.  
  150.  
  151. <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement