New user needs help with $paged variable
-
I am very new to WordPress and need help paginating query results. The site I manage has a “News” category, and has been coded (by a techie who is no longer on the team so I can’t ask him) such that when a visitor clicks “Get all news,” all the news posts show up on one page.
We have over 100 posts now and the list grows daily.
I would like the posts list paginated so that there are maybe 20 posts per page, with a link to next page/previous page.
I am clueless.
Here’s the coding we have for catergory-news.php:
<?php get_header(); ?>
<div id=”newspagecolumn”>
<h1>News</h1>
<?php$postcount = 0;
$featured_query = new WP_Query(‘category_name=News’);
while ($featured_query->have_posts()) : $featured_query->the_post();
$do_not_duplicate[] = get_the_ID();
$postcount++;
?>
<div id=”newspage”>
<span class=”newspageheader”>“><?php the_title(); ?></span>
<div id=”newsdate”><span class=”newsmonth”><?php the_time(‘M’) ?></span> <span class=”newsday”><?php the_time(‘d’) ?></span></div>
<div class=”newspagecontent”><?php the_excerpt(); ?></div><div class=”readmore”>“>read more…</div></div><!– End Panel –>
<?php endwhile; ?></div>
<?php get_footer(); ?>
Please, somebody, tell me where I put the $paged stuff? And how exactly does it need to read? (And please forgive me if this is covered elsewhere–I’ve been researching for days but can’t seem to find an answer that makes sense to me, WordPress n00b that I am…)
The topic ‘New user needs help with $paged variable’ is closed to new replies.