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 made a new WordPress Theme and ive done .. but i have one problem. I can't get the pagination work. I use the "wp-paginate" plugin and i have put the folloing code on my index.php

<?php if(function_exists('wp_paginate')) {
wp_paginate();
} ?>

But that doesn't work for my site. There is still nothing on the frontend and in the markup. What can i do?

Here is my index.php:

    <?php get_header(); ?>


<div id="wraper">

<div id="main" role="main">

    <article>

    <?php if ( ! have_posts() ) : ?>
        <header>
            <h1>Nicht gefunden!</h1>
        </header>

        <p>Sorry, leider konnte der gew&uuml;nschte Artikel nicht gefunden werden. Vielleicht hilft Ihnen die suche ja weiter!</p>
    <?php endif; ?>

    <?php while ( have_posts() ) : the_post(); ?>

        <?php get_template_part( 'loop-index', 'index' ); ?>

    </article><!-- post -->

    <?php endwhile; ?>

</div> <!-- end #wraper -->

<?php if(function_exists('wp_paginate')) {
    wp_paginate();
} ?>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

If this is a new WordPress install, it is likely that you don't actually have enough posts to require pagination, and thus the pagination links aren't appearing.

Quick test: ensure you have at least two posts, then go to Dashboard -> Settings -> Reading, and change the "Posts Per Page" setting to 1. Do you see pagination links?

share|improve this answer
    
Thank You Chip .. Shame on me :D –  hazelnut Nov 1 '11 at 15:17
add comment

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.