Query all posts in a certain category
I've been trying to show all post in a page of a certain category. Here's
what I did so far:
<?php
$args = array(
'category_name' => 'diy-tutorial',
'post_type' => 'post',
'posts_per_page' => 3
//'paged' => ( get_query_var('paged') ?
get_query_var('paged') : 1),
);
query_posts($args);
$x = 0;
while (have_posts()) : the_post(); ?>
It's actually working but it wouldn't let me navigate for the next pages
of the categories Like for example, i have 30 posts in that certain
category, so my code will show me three posts per page right? The next>>
link won't show up as well as if I change the number of posts to show per
page, it won't work as well...
If you have an alternative way of showing it please let me know.
No comments:
Post a Comment