WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WP-Paginate] With query-post doesn't works :( (4 posts)

  1. car3699
    Member
    Posted 4 years ago #

    Hi!...
    I'm working on a site with the category "blog" for posts that the editor can upload.

    The problem is that the wp-paginate only links on the first page... doesn't works for the any other...

    Anybody knows a solution for this?.

    This is part of the code i'm using:

    <?php query_posts('posts_per_page=4&category_name=blog');
    
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <h2><a href="<?php echo get_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <?php the_content('Leer el resto del art&iacute;culo'); ?>
    
    <?php endwhile; else: ?>
    
    <?php endif; ?>
    
    <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?>
    <?php wp_reset_query(); ?>

    Thanx!

    http://wordpress.org/extend/plugins/wp-paginate/

  2. Eric Martin
    Member
    Posted 4 years ago #

    You need to include the page variable. Example:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("posts_per_page=4&category_name=blog&paged=$paged");
  3. car3699
    Member
    Posted 4 years ago #

    Thanks emartin24!!!!!!
    :D

  4. noise
    Member
    Posted 3 years ago #

    any thoughts on where in the string that goes? after the query_posts('posts_per_page=4&category_name=blog');
    or before the wp_paginate

Topic Closed

This topic has been closed to new replies.

About this Topic