Forums

x posts per page in category... - own template page (3 posts)

  1. yozz84
    Member
    Posted 1 year ago #

    how to change this code to show only 4 posts per page in 'www' category?

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
    <?php query_posts('category_name=www&paged=' . $paged); ?>
    
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="bb-100" id="post-<?php the_ID(); ?>">
    
    <h4><?php the_title(); ?></h4>
    <?php the_content('Czytaj dalej &raquo;'); ?>
    
    </div>
    
    <?php endwhile; ?>
    
    <div class="bb-t30 nav-entry-pages">
    <div class="bb-t27 bb-fc bb-marg-nav"><?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?></div>
    </div>
    
    <?php else : ?>
    
    <h1>error</h1>
    
    <?php endif; ?>
  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    read the 'query_posts' docu:
    http://codex.wordpress.org/Function_Reference/query_posts

    and if you still have questions, report back.

  3. yozz84
    Member
    Posted 1 year ago #

    is this good?
    <?php query_posts('category_name=www&paged=' . $paged, 'posts_per_page=3'); ?>

    because its not working :/

    when i try this:
    <?php query_posts('posts_per_page=3', 'category_name=www&paged=' . $paged); ?>
    it's also wrong becasue its show me posts which arent in www category...

    sorry but my php is not so good ;) im new and green ;P

    thx for helping me

Topic Closed

This topic has been closed to new replies.

About this Topic