• hi, sorry i think i posted this in the wrong section before as no one answering!

    i want to make it so if anyone clicks on a category’s, a list of my posts show up in a small list eg: screen shot.
    http://i43.tinypic.com/28ip4x2.jpg

    click category>>> then the posts i have created appear as a neat list, not like when you click a category your posts show up 1 after another with the content.

    thanks if anyone can help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • click category>>> then the posts i have created appear as a neat list, not like when you click a category your posts show up 1 after another with the content.

    The display of category archives is controlled by Category Templates so if you were using the WordPress Default Theme you could create a template called category.php with this code:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
    		<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.
    
    		<?php get_search_form(); ?>
    
    	<?php endif; ?>
    
    <?php
    //}
    ?>
    
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy
    the_content()
    the_title()
    the_permalink()

    Thread Starter blackss32

    (@blackss32)

    thanks m8, very close, the posts show up in the middle and the category list is gone from the right to the left lol.

    Well you’ll have to adjust/edit/add div’s based on your theme. Look at your theme’s index.php for ideas.

    Thread Starter blackss32

    (@blackss32)

    ok thanks, all looks ok for now, just not sure where in the Stylesheet (style.css) i have to add the background color for the new category template. im not sure off what the code would look like either, font and stuff are ok just not the page background in category template.

    I’ll direct you to CSS.

    Thread Starter blackss32

    (@blackss32)

    thanks, i think this is as far as i’ll get, apart from being a poor reader, i cant see why:
    .category {
    background: #FFF url(images/grad.gif) repeat-x;
    }

    is not working…

    cheers.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘post list’ is closed to new replies.