WordPress.org

Ready to get started?Download WordPress

Forums

WP-Paginate
WP-Paginate - Template file - Alwayes return to the first page (2 posts)

  1. Zarce Baron
    Member
    Posted 1 year ago #

    I'm using the WP-Paginate plugin in a custom template file, but no matter what link I click, it always return to the first page. I'm using it in archive templates as well and it's working just fine.

    The code wich is returning the mentioned error is:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

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

  2. Zarce Baron
    Member
    Posted 1 year ago #

    I'm writing to show my code, wich was moderated due to its size.
    So, the code is:

    <?php query_posts('category_name=category-name'); ?>
        <?php if (have_posts()) : ?>
             <h2>Title</h2>
                	<?php while (have_posts()) : the_post(); ?>
                                <h3><?php the_title(); ?></h3>
    		<?php endwhile; ?>
    		<?php if(function_exists('wp_paginate')) {
                        wp_paginate();
                    } ?>
      <?php endif; ?>

    My problem is that, the plugin creates the following url:
    http://www.mysite.com/TEMPLATE-PAGE/page/2/
    Once it happens, I'm redirected to the first page every time.

    But what I really needed is that the plugin creates a url like this:
    http://www.entrecactoos.com.br/category/CATEGORY-NAME/page/2/

    Where, my CATEGORY-NAME is the name of the category I'm calling with the query_post tag, at the beginning of my code.

    I need it to create a friendly SEO url that has /TEMPLATE-PAGE immediately after the http://www.mysite.com. If anyone knows an alternative to achieve it instead of creating a template page wich calls a loop of results, similar to the archive template but with a specific category, please help me!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic