• I want to limit the number of post on front page only which is currently set to only show all posts from one category.

    I’ve tried loads of plugins but they only limit the post in the actualy catergories, not the front page.

    Any help would be great! Cheers!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter toni2

    (@toni2)

    This is great but it is including other posts from other categories, when I want just the one categorys displayed on the from page.

    try:

    <?php
    $page_num = $paged;
    if ($pagenum='') $pagenum =1;
    query_posts('cat=1&showposts=7&paged='.$page_num); ?>
                   	<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
                    // WordPress loop
                    endwhile;endif; ?>

    Where the query_posts cat=1 is set to the category ID that you want to pull from.

    Thread Starter toni2

    (@toni2)

    Thankyou it worked!!

    Excellent! You are most welcome…

    OMG I’ve been trying to figure this out for days thanks.

    I commented out these two lines of code in index.php:

    <?php $countervariable=1; if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    I added this: (from the url mentioned above in second post)

    <?php
    $page_num = $paged;
    if ($pagenum='') $pagenum =1;
    query_posts('showposts=7&amp;paged='.$page_num); ?>
                   	<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
                    // WordPress loop
                    endwhile;endif; ?>

    On home page I an getting ERROR:

    Parse error: syntax error, unexpected $end in /home/my/path/to/blog/index.php on line 77

    Anybody can help? (I tested with default theme too. But same error)

    thanks.

    After searching the internet for 40 minutes, I found out that ‘Settings > Reading > Posts’ can be set to the number I want!

    ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘limit number of post on front page only’ is closed to new replies.