• Resolved buttonedorg

    (@buttonedorg)


    I just installed wordpress and it’s working great, but there’s one thing I haven’t figured out how to do.

    I have set my posts per page to 1, but it’s showing 1 post on both my main and category pages. How do I make it show 1 post on the main page, but a list of all posts within that category on the category pages?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter buttonedorg

    (@buttonedorg)

    This is my current code:

    [quote]<?php get_header(); ?>
    <div id=”content” class=”clearfix”></p>
    <p> <div id=”left-col”></p>
    <p> <?php if (have_posts()) : ?>
    <?php
    if(isset($_GET[‘author_name’])) :
    $curauth = get_userdatabylogin(get_the_author_login());
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?>
    <div class=”twitter clearfix”>
    <p class=”color-blue”>
    <?php $post = $posts[0]; ?>
    <?php if (is_category()) { ?>
    <h4 class=”font-georgia”>Archive for the ‘<?php single_cat_title(); ?>’ Category</h4>
    <?php } elseif( is_tag() ) { ?>
    <h4 class=”font-georgia”>Posts Tagged ‘<?php single_tag_title(); ?>’</h4>
    <?php } elseif (is_day()) { ?>
    <h4 class=”font-georgia”>Archive for <?php the_time(‘F jS, Y’); ?></h4>
    <?php } elseif (is_month()) { ?>
    <h4 class=”font-georgia”>Archive for <?php the_time(‘F, Y’); ?></h4>
    <?php } elseif (is_year()) { ?>
    <h4 class=”font-georgia”>Archive for <?php the_time(‘Y’); ?></h4>
    <?php } elseif (is_author()) { ?>
    <h4 class=”font-georgia”>Author Archive: <?php echo $curauth->display_name; ?></h4>
    <?php } elseif (isset($_GET[‘paged’]) && !empty($_GET[‘paged’])) { ?>
    <h4 class=”font-georgia”>Blog Archives</h4>
    <?php } ?>
    </p>
    <!– End Title –></p>
    <p> <?php while (have_posts()) : the_post(); ?></p>
    <p> <?php // To show only 1 Category
    $category = get_the_category();?></p>
    <p> <div class=”post-content clearfix”>
    ” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?>
    </div><!– End post-content (post-<?php the_ID(); ?>) –></p>
    <p> </div><!– End post-<?php the_ID(); ?> –></p>
    <p> <?php endwhile; ?></p>
    <p> <div class=”single-meta clearfix”>
    <div class=”left”><h4 class=”single-info font-georgia color-white size”><?php next_posts_link(‘? Older Entries’) ?></h4></div>
    <div class=”right”><h4 class=”single-info font-georgia color-white”><?php previous_posts_link(‘Newer Entries ?’) ?></h4></div>
    </div></p>
    <p> <?php endif; ?></p>
    <p> </div><!– End left-col –></p>
    <p> <?php get_sidebar(); ?><!– End right-col –></p>
    <p> </div><!– End content –>
    <?php get_footer(); ?>[/quote]

    Thread Starter buttonedorg

    (@buttonedorg)

    I tried installing the category list addon and put [catlist] where I want the posts to be listed, but it just displays [catlist] -.-

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show one post on main page and list in category page’ is closed to new replies.