Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i have a problem with the page navigation, on the homepage of my website page navigation not working, when i click on page number 2 or 3 it says "Not found".

But in the categories page is working fine, only on the homepage gives this problem.

Actually im using the default permalinks.

Here is the website if you want to try and test it www.onstreaming.net

Here is the index:

<?php get_header(); ?>

<div id="content">

<?php 
$postct = get_option('dion_postnum'); 
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array('post_type' => 'videos','post_status'=> 'publish','posts_per_page' =>$postct,'caller_get_posts'  =>1,'paged' =>$paged,);
query_posts($args);
if (have_posts()) : while (have_posts()) : the_post(); 
?>

<div class="box rounded <?php if (++$counter % 4 == 0) { echo "lastbox"; }?>" id="post-<?php the_ID(); ?>">

<?php require('postcover.php'); ?>

</div>

<?php endwhile; ?>

<div class="clear"></div>

<div id="navigation">
<?php
if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
?>

</div>
<?php wp_reset_query();?>

<?php else : ?>

    <div class="title"><h2>Oops.. Nothing Found !</h2></div>
    <div class="cover"> <p>I think what you are looking for is not here or it has been moved. Please try a different search..</p> </div>


<?php endif; ?>

</div>


<?php get_footer(); ?>

So i hope somebody can help me with this big problem, thanks a lot.

share|improve this question

1 Answer 1

Andre, you are using $paged variable as an argument for your query, but you haven't declared that variable. Try declaring that variable above the arguments using:

<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
?>  

Hope this will solve your problem.

Moreover its better to use the content for postcover.php on the same page instead.

share|improve this answer
    
And where should i paste this code exactly ? –  Andre Shirani Oct 27 '12 at 8:25
    
You can paste this code above query posts arguments. I have edited your code and added the required variable. –  swtshweta Oct 27 '12 at 8:27
    
i have tried a couple of times but it gives me the same problem =( any other idea ? –  Andre Shirani Oct 27 '12 at 8:57
    
Anybody can help me ? –  Andre Shirani Oct 29 '12 at 7:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.