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.
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&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!
🙂