- <?php
- /**
- * Category Template
- */
- get_header(); // Loads the header.php template. ?>
- <?php do_atomic( 'before_content' ); // prototype_before_content ?>
- <div id="content">
- <?php do_atomic( 'open_content' ); // prototype_open_content ?>
- <div class="hfeed">
- <?php if ( have_posts() ) : ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php do_atomic( 'before_entry' ); // prototype_before_entry ?>
- <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
- <?php do_atomic( 'open_entry' ); // prototype_open_entry ?>
- <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
- <div class="photos">
- <?php get_main_image(); ?>
- <div class="thumbs">
- <!-- Display the Post's Remaining Image Attachments. -->
- <?php get_thumbs(); ?>
- </div></div>
- <div class="entry-content">
- <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', hybrid_get_textdomain() ) ); ?>
- <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', hybrid_get_textdomain() ), 'after' => '</p>' ) ); ?>
- </div><!-- .entry-content -->
- <?php do_atomic( 'close_entry' ); // prototype_close_entry ?>
- </div><!-- .hentry -->
- <?php do_atomic( 'after_entry' ); // prototype_after_entry ?>
- <?php get_sidebar( 'after-singular' ); // Loads the sidebar-after-singular.php template. ?>
- <?php do_atomic( 'after_singular' ); // prototype_after_singular ?>
- <?php comments_template( '/comments.php', true ); // Loads the comments.php template. ?>
- <?php endwhile; ?>
- <?php endif; ?>
- </div><!-- .hfeed -->
- <?php do_atomic( 'close_content' ); // prototype_close_content ?>
- <?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
- </div><!-- #content -->
- <?php do_atomic( 'after_content' ); // prototype_after_content ?>
- <?php get_footer(); // Loads the footer.php template. ?>
- <?php
- /**
- * Single-Portfolio Template
- */
- get_header(); // Loads the header.php template. ?>
- <?php do_atomic( 'before_content' ); // prototype_before_content ?>
- <div id="content">
- <?php do_atomic( 'open_content' ); // prototype_open_content ?>
- <div class="hfeed">
- <?php if ( have_posts() ) : ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php do_atomic( 'before_entry' ); // prototype_before_entry ?>
- <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
- <?php do_atomic( 'open_entry' ); // prototype_open_entry ?>
- <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
- <div class="photos">
- <?php get_main_image(); ?>
- <div class="thumbs">
- <!-- Display the Post's Remaining Image Attachments. -->
- <?php get_thumbs(); ?>
- </div></div>
- <div class="entry-content">
- <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', hybrid_get_textdomain() ) ); ?>
- <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', hybrid_get_textdomain() ), 'after' => '</p>' ) ); ?>
- </div><!-- .entry-content -->
- <?php do_atomic( 'close_entry' ); // prototype_close_entry ?>
- </div><!-- .hentry -->
- <?php do_atomic( 'after_entry' ); // prototype_after_entry ?>
- <?php get_sidebar( 'after-singular' ); // Loads the sidebar-after-singular.php template. ?>
- <?php do_atomic( 'after_singular' ); // prototype_after_singular ?>
- <?php comments_template( '/comments.php', true ); // Loads the comments.php template. ?>
- <?php endwhile; ?>
- <?php endif; ?>
- </div><!-- .hfeed -->
- <?php do_atomic( 'close_content' ); // prototype_close_content ?>
- <?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
- </div><!-- #content -->
- <?php do_atomic( 'after_content' ); // prototype_after_content ?>
- <?php get_footer(); // Loads the footer.php template. ?>
- ///////////////////////////////////////////////////////////////////////////////////////////
- // The get_children() function call made in get_main_images() in functions.php
- ////////////////////////////////////////////////////////////////////////////////////////////
- function get_main_image($size = 'large', $limit = '1', $offset = '0', $post) {
- $images = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );
- if ($images) {
- $num_of_images = count($images);
- if ($offset > 0) : $start = $offset--; else : $start = 0; endif;
- if ($limit > 0) : $stop = $limit+$start; else : $stop = $num_of_images; endif;
- $i = 0;
- foreach ($images as $image) {
- if ($start <= $i and $i < $stop) {
- $img_title = $image->post_title; // title.
- $img_description = $image->post_content; // description.
- $img_caption = $image->post_excerpt; // caption.
- $img_url = wp_get_attachment_url($image->ID); // url of the full size image.
- $preview_array = image_downsize( $image->ID, $size );
- $img_preview = $preview_array[0]; // thumbnail or medium image to use for preview.
- ?>
- <a href="<?php echo $img_url; ?>" title="<?php echo $img_title; ?>" >
- <img id="photo" src="<?php echo $img_preview; ?>" alt="<?php echo $img_caption; ?>" title="<?php echo $img_title; ?>"></
- <?
- // End custom image tag. Do not edit below here.
- ///////////////////////////////////////////////////////////
- }
- $i++;
- }
- }
- }