The MU forums have moved to WordPress.org

Select types of post to show after asides loop (3 posts)

  1. JMF
    Member
    Posted 17 years ago #

    I'm needing to modify themes so that they display only one category of posts (cat 1) on the front page for all my users (reasons here).

    I'd been using

    if (is_home()) { query_posts("cat=1"); }
    to do that, but a theme I'm looking at now loops this way (I guess because it uses asides:

    
    <?php if ($posts) {
    
    [aside stuff here, it looks like]
    
    foreach($posts as $post)
    {
    start_wp();
    ?>
    <?php if ( in_category($AsideId) && !is_single() ) : ?>
    <ul class="asides">
    <li id="p<?php the_ID(); ?>">
    <?php echo wptexturize($post->post_content); ?>
    <br/>
    <?php comments_popup_link('(0)', '(1)','(%)')?>  | <a href="<?php the_permalink(); ?>" title="Permalink: <?php echo wptexturize(strip_tags(stripslashes($post->post_title), '')); ?>" rel="bookmark">#</a> <?php edit_post_link('(edit)'); ?>
    </li>
    </ul>
    <?php else: // If it's a regular post or a permalink page ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <div class="posttitle">
    [...and we're off with the regular post code...]
    

    Could anyone show me where I need to bust into that with my 'Hey, only show posts from one category if it's the Home page' code? Or do I need to do it some other way?

  2. Ovidiu
    Member
    Posted 17 years ago #

    first thing that comes to my mind would be using a plugin that restricts which cats posts are shown on the frontpage. there are plenty of those around here...

  3. JMF
    Member
    Posted 17 years ago #

    Gotcha. I had tried the Front Page Excluded Categories plugin in mu-plugins without any luck, but switching that out, and using Front Page Cats instead does the trick... that one was just a little harder to track down, for some reason.

    Thanks!

About this Topic