• Hi all – I am trying to customize the loop of a theme to show only posts from a certain category. I don’t want to use the category page for this, I’d really like to show just one category of post. I realize this is probably more than is needed to show you, but here is my loop –

    <?php $cat_query = '';
    if ( !empty($blog_cats) ) $cat_query = '&cat=' . implode(",", $blog_cats);
    else echo '<!-- blog category is not selected -->'; ?>
    <?php
    	$et_paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );?>
    <?php query_posts("posts_per_page=$et_ptemplate_blog_perpage&paged=" . $et_paged . $cat_query); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<div class="et_pt_blogentry clearfix">
    		<h2 class="et_pt_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

    I’ve done quite a bit of research into how to do this but all of the sources I’ve seen reference a generic loop, not one customized (as far as I can tell) with so many variables.

    Any help is appreciated! Thanks for your time!

    – Glenn

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Help customizing loop to show one category’ is closed to new replies.