Support » Themes and Templates » Making an "all posts" category???

  • I’m currently using the “Church theme” by studiopress, and on my website, theres options to show latest posts from three categories on the home page (left block, right block, and bottom block). On the bottom block, I want to show all recent posts, not just from a specific category.

    Either I:
    1. Somehow make a category that contains all posts.
    2. Edit the home template.

    Here’s my code for that block in home.php:

    <div id="homepagebottom">
    			<div class="hpbottom">
    <h3><?php echo cat_id_to_name(get_theme_mod('featured_bottom')); ?></h3>
    				<?php $recent = new WP_Query("cat=".get_theme_mod('featured_bottom')."&showposts=".get_theme_mod('featured_bottom_num')); while($recent->have_posts()) : $recent->the_post();?>
    				<?php if( get_post_meta($post->ID, "thumb", true) ): ?>
    				<a href="<?php the_permalink() ?>" rel="bookmark"><img class="thumb" src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=<?php echo get_theme_mod('featured_bottom_thumb_height'); ?>&w=<?php echo get_theme_mod('featured_bottom_thumb_width'); ?>&zc=1" alt="<?php the_title(); ?>" /></a>
    				<?php else: ?>
    				<?php endif; ?>				
                    <strong><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></strong>
    				<?php the_content_limit(350, __("[Read more of this review]", 'studiopress')); ?>
    				<?php endwhile; ?>
    				<?php $cat = get_category(get_theme_mod('featured_bottom')); ?>
    				<strong><a href="<?php echo get_category_link(get_theme_mod('featured_bottom')); ?>" rel="bookmark"><?php echo __("Read More Posts From ", 'studiopress')." ".$cat->name; ?></a></strong>

    Help is greatly appreciated! Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator cubecolour



    You’ll probably get the most relevant answer for how to achieve this with your theme on the studiopress forum – that’s partly what you paid for when you bought the theme.



    Forum Moderator

    try to use "cat=0&showposts.... in this line:

    <?php $recent = new WP_Query("cat=".get_theme_mod('featured_bottom')."&showposts=".get_theme_mod('featured_bottom_num')); while($recent->have_posts()) : $recent->the_post();?>

    but then you will run into the issue of duplicate posts …

    @alchymyth, thanks, it shows my latest posts with a few undesirable things, but is there any way i can just make a category with the latest posts in order? That would be the most effective

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Making an "all posts" category???’ is closed to new replies.