Answer the question
In order to leave comments, you need to log in
The $paged Wordpress global variable is set to 0. Why?
I want to make a static page with navigation. CMS wordpress. A piece of code below.
$wp_query = new WP_Query(); $wp_query->query('showposts=3' . '&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
$pageNum=(get_query_var('paged')) ? get_query_var('paged') : 1;
Answer the question
In order to leave comments, you need to log in
$paged=(get_query_var('paged')) ? get_query_var('paged') : 1;
$wp_query = new WP_Query(array('posts_per_page'=>3,'paged'=>$paged));
if ( $wp_query ->have_posts() ) {
while ( $wp_query ->have_posts() ) {
$wp_query ->the_post();
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question