Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <?php if( $wp_query->current_post == 0 && !is_paged() ) : //first post// ?>
- <div class="bw-featured clear">
- <?php
- $parent_cat = array();
- $post_cats = get_the_category($post->ID);
- foreach( $post_cats as $post_cat ) {
- if( $post_cat->parent ) $parent_cat[] = get_category( $post_cat->parent )->slug;
- }
- ?>
- <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
- <center><a href="<?php the_permalink() ?>"><img src="<?php echo $image[0]; ?>" /></a></center>
- <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
- <p class="post-content"><?php if (function_exists('smart_excerpt')) smart_excerpt(get_the_excerpt(), 28); ?> <a href="<?php the_permalink(); ?>">Read More</a></p>
- </div><!--end featured-->
- <?php else : ?>
- <?php if( ($wp_query->current_post == 0 && is_paged()) || ($wp_query->current_post == 1 && !is_paged()) ) { //open the #loop div only after the first post on the first page or direct for the other pages// ?>
- <div id="loop" class="<?php if ($_COOKIE['mode'] == 'grid') echo 'grid'; else echo 'list'; ?> clear">
- <?php } ?>
- <div <?php post_class('post clear'); ?> id="post_<?php the_ID(); ?>">
- <?php if ( has_post_thumbnail() ) :?>
- <a href="<?php the_permalink() ?>" class="thumb"><?php the_post_thumbnail('thumbnail', array(
- 'alt' => trim(strip_tags( $post->post_title )),
- 'title' => trim(strip_tags( $post->post_title )),
- )); ?></a>
- <?php endif; ?>
- <h6 class="post_channel"><?php the_category('<a class="post_channel"></a>'); ?></h6>
- <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
- <div class="post-meta">by
- <span class="post-author"><a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" title="Posts by <?php the_author(); ?>"><?php the_author(); ?></a></span>
- Published
- <span class="post-date"><?php the_time(__('M j, Y')) ?></span>
- |
- <span><?php the_time() ?></span>
- |
- <?php comments_popup_link(__('No Comments'), __('1 Comment'), __('% Comments'), '', __('Comments Closed')); ?> <?php edit_post_link( __( 'Edit entry'), '<em>• </em>'); ?>
- </div>
- <p class="post-content"><?php if (function_exists('smart_excerpt')) smart_excerpt(get_the_excerpt(), 28); ?> <a href="<?php the_permalink(); ?>">Read More</a></p>
- </div>
- <?php endif; //ends "if( $wp_query->current_post == 0 && !is_paged() )"// ?>
- <?php endwhile; ?>
- <?php if( $wp_query->post_count > 1 || is_paged() ) } ?>
- </div>
- <?php } ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement