Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php /* Suggestions welcome to tidy up this loop */ ?>
- <?php /* Show ONE post from category 7 in div#featured */
- $featured_query = new WP_Query( 'cat=7&posts_per_page=1' );
- if ( $featured_query->have_posts() ) while ( $featured_query->have_posts() ) : $featured_query->the_post(); ?>
- <div id="featured">
- <img src="<?php echo get_post_meta($post->ID, "articleimg", TRUE); ?>" width="306px" height="365px" alt="<?php the_title(); ?>" /><?php echo $fdesc; ?>
- <div class="overlay">
- <p><strong>
- <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></strong><br />
- <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_excerpt(); ?></a>
- </p>
- </div>
- </div>
- <?php endwhile;
- /* Show THREE post excerpts from all categories except category 7 in div#articles */
- $excerpt_query = new WP_Query( 'cat=-7' ); ?>
- <div id="articles">
- <?php
- if ( $excerpt_query->have_posts() ) :
- $count = 4;
- while ( $excerpt_query->have_posts() ) : $excerpt_query->the_post();
- if ( $count < 7 ) { ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
- <?php the_title(); ?></a></h2>
- <?php the_excerpt(); ?>
- <p class="comments">
- <?php comments_popup_link('0', '1', '%'); ?>
- </p>
- </div>
- <?php
- /*
- * Show the next four post TITLES ONLY excerpts from all categories except
- * category 7 in an UNORDERED LIST, still within div#articles
- */
- } else if ( $count < 11 ) {
- if ( $count == 7 ) {
- echo '<ul>';
- } ?>
- <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
- <?php
- if ( $count == 10 ) {
- echo '</ul>';
- }
- $count++;
- }
- endwhile;
- endif; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement