• iamopensource

    (@iamopensource)


    Hi,
    When I click on a category called services, the URL becomes:
    https://localhost/mysite/category/services

    and all the posts under this category are displayed.

    I’ve two questions
    1. How to create a page to change the default presentation of this page?

    2. Can we have paginated results? e.g. show only 10 posts under this category per page.

    Please guide.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • jchiappisi

    (@jchiappisi)

    1. You can change this page’s presentation through the Category Template, which can be named category.php. You can also create category-services.php, assuming that your category slug is ‘services’. This would use this category template for that specific category.

    2. You can specify number of posts returned within the query, limiting it to 10 if you wish.

    Thread Starter iamopensource

    (@iamopensource)

    Thanks, it helped me, I created category.php and its working fine now.

    The only thing now I want to understand is how to paginate it? I’m currently doing the following and its listing all the posts under a category:

    while (have_posts()) : the_post(); ?>
    
    					<h1><a href="<?php the_permalink(); ?>" title="<?php the_title();//printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    					<!--<p class="post_author"><em>by</em> <?php the_author(); ?></p>-->
    					<div class="format_text">
    <?php the_content('<p>Read the rest of this entry &raquo;</p>'); ?>
    <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
    					</div>
    
    				<?php comments_template(); ?>
    <?php
    					endwhile;

    How do I get paginated results e.g. 10 posts per page and then a navigation bar at the bottom of the page / below last post of the page.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where is the template that displays posts of the selected category?’ is closed to new replies.