Display posts in page using mullet loop
-
I’m trying to display posts in a page template so my site has another blog page that displays only posts with a certain category. I found this code and it works fine to show all my posts in the same basic layout.
I want to customize that code to use the mullet loop like my index.php and also only display a certain category.
Here’s my modified mullet loop located in index.php:
<?php if (have_posts()) : ?> <?php $count = 0; ?> <?php while (have_posts()) : the_post(); ?> <?php $count++; ?> <?php if ($count == 1) : ?> <div id="recentpost"> <div id="post-<?php the_ID() ?>" class="post"> <div id="postthmb"> <img src="<?php echo get_post_meta($post->ID, "Thumbnailbg", true);?>" /> </div> <div id="posttext"> <h2 class="post-title2"><a href="<?php the_permalink() ?>" title="<?php the_title() ?>" rel="bookmark"><?php the_title() ?></a></h2> <div class="post-meta2"><?php the_time('F j, Y'); ?></div> <div class="post-content2"> <?php the_excerpt('Click here to read more »'); ?> </div> <div id="readmorej2"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">READ MORE...</a></div> </div> </div> </div> <?php else : ?> <div id="post-<?php the_ID() ?>" class="post"> <div id="postthmb"> <img src="<?php echo get_post_meta($post->ID, "Thumbnailbg", true);?>" /> </div> <div id="posttext"> <h2 class="post-title"><a href="<?php the_permalink() ?>" title="<?php the_title() ?>" rel="bookmark"><?php the_title() ?></a></h2> <div class="post-meta"><?php the_time('F j, Y'); ?></div> <div class="post-content"> <?php the_excerpt('Click here to read more »'); ?> </div> <div id="readmorej"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">READ MORE...</a></div> </div> </div> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?>
Any help would be appreciated!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Display posts in page using mullet loop’ is closed to new replies.