WordPress.org

Ready to get started?Download WordPress

Forums

WP-Paginate
paginate don't work on the start-page (2 posts)

  1. deniswelsch
    Member
    Posted 3 years ago #

    hi,

    first, sorry for my bad english i hope you can understand what i'm writing.

    i'm working on a new theme and i'm using wp-paginate.
    the start-page is a page that i've created. the name of this page is main. on this page there will be only 2 posts from a specific category.

    this is the code from main:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("posts_per_page=2&category_name=mixes&paged=$paged");
    
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <!-- begin blogPost -->
    <div class="blogPost_main">
    <?php echo get_the_post_thumbnail($id, 'large'); ?>
    <span><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></span><br />
    <span class="category"><?php the_category(', ') ?></span>
    </div>
    <!-- end blogPost -->
    
    <?php endwhile; ?>
    
    <!-- begin navigation -->
    <div id="navigation">
    
    <?php if(function_exists('wp_paginate')) {
                    wp_paginate();
                    }
    ?>
    
    </div>
    <!-- end navigation -->
    
    <?php else : ?>
    
    <h2 class="center">Nicht gefunden</h2>
    <p class="center">Sorry, aber du suchst gerade nach etwas, was hier nicht ist.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    <?php endif; ?>

    the problem is that paginate only shows the content from the first page if i browse on another page. but...

    i've created another page with the name blog. on this page there will be shown all posts and on this page (that page isn't the startpage) paginate works fine.

    this is the code from blog:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("posts_per_page=10&paged=$paged");
    
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <div class="blogPost" id="post-<?php the_ID(); ?>">
    <h1><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
    <div class="category"><?php the_category(', ') ?></div>
    <?php the_content('Weiterlesen »'); ?>
    </div>
    
    <?php endwhile; ?>
    
    <?php if(function_exists('wp_paginate')) {
                wp_paginate();
                }
    ?>
    
    <?php else : ?>
    
    <h2 class="center">Nicht gefunden</h2>
    <p class="center">Sorry, aber du suchst gerade nach etwas, was hier nicht ist.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    <?php endif; ?>

    if i make the blog page as a start-page suddenly paginate don't work. it's the same with the main page.

    the fact is that paginate on a start-page only shows the content from the first page if i browse on another page. if the page isn't a startpage paginate works finde.

    whats the problem here?

    greetings

  2. Eric Martin
    Member
    Plugin Author

    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic