Support » Plugin: WP-Paginate » [Plugin: WP-Paginate] WP Paginate Plugin Help

  • Resolved martinfamily2005

    (@martinfamily2005)


    Using WP Paginate on my archives.php page, but it is not working. When I look at the page source, I can see the <div is=”navigate”> code, and then nothing else. Can you help me out with this?

    Example page: http://billboardfamily.com/daily-t-shirt-blogs/

    Here is the code on my page:

    <?php include("header.php"); ?>
    <?php include ('sidebar_archive.php'); ?>
    
    <!-- BEGIN content -->
    <div id="content">
    
        <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
        <?php /* If this is a category archive */ if (is_category()) { ?>
        <h2 class="title">Archive for the <strong><?php single_cat_title(); ?></strong> Category</h2>
        <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
        <h2 class="title">Posts Tagged <strong><?php single_tag_title(); ?></strong></h2>
        <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
        <h2 class="title">Archive for <?php the_time('F jS, Y'); ?></h2>
        <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
        <h2 class="title">Archive for <?php the_time('F, Y'); ?></h2>
        <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
        <h2 class="title">Archive for <?php the_time('Y'); ?></h2>
        <?php /* If this is an author archive */ } elseif (is_author()) { ?>
        <h2 class="title">Author Archive</h2>
        <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
        <h2 class="title">Blog Archives</h2>
        <?php } ?>
    
        <?php
        if (have_posts()) :
        while (have_posts()) : the_post();
        ?>
    
        <!-- BEGIN post -->
        <div class="post">
            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
            <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?></div>
        <!-- END post -->
    
        <?php endwhile; ?>
    
        <?php else : ?>
        <div class="notfound">
            <h2>Not Found</h2>
            <p>Sorry, but you are looking for something that is not here.</p>
        </div>
        <?php endif; ?>
    
    </div>
    <!-- END content -->
    
    <? get_footer(); ?>

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

Viewing 15 replies - 1 through 15 (of 22 total)
  • maybe this<? get_footer(); ?> vs.<?php get_footer(); ?> – depends on your configuration whether shortcode is supported or not.

    fixed that…..but still does not work.

    Plugin Author Eric Martin

    (@emartin24)

    You might try moving the wp_paginate call outside of your while loop. If that does not help, let me know.

    -Eric

    that did not work. even tried to move it past the endif tag….still nothing

    Anyone?

    Michael

    (@alchymyth)

    Forum Moderator

    what if you offer a normal wordpress function as an ‘else’ to the conditional statement:

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

    http://codex.wordpress.org/Function_Reference/posts_nav_link

    is your plugin activated?
    does the ‘wp_paginate()’ it work on other pages, such as index.php?

    I just tried that….no change. The plugin is indeed activated. I have not tried to use this on any other pages….I only want to use it on this page, so I did not try that.

    Plugin Author Eric Martin

    (@emartin24)

    The plugin uses WordPress values, so it sounds like there is an issue with your WordPress “display” settings. Even more so if you say the standard WP Prev/Next links don/t show up…

    Michael

    (@alchymyth)

    Forum Moderator

    just checking the obvious:

    -there are more posts in that archive than now on the page?

    -setting in admin ‘settings’ ‘reading’ ‘Blog pages show at most [] posts’ is set to 9 ?

    -can you update the code that you posted?

    (the above does not even contain the <div id="pagination">; and has no date output, and has the <div class="post"> while the linked page has a class “archive-posts”)
    just to make sure you are looking at the right file.

    Those are all the posts in that category as of now. Shouldn’t the paginate still show up? It would just have one page to choose from, correct? I did not see anywhere in the plugin control panel to set the number of posts per page.

    In the “reading” settings the number is set to 10. I just tried to set it to a few other numbers (2, 5, etc)….no change on the page.

    That <div id=”pagination”>; tag is actually created within the Pagination plugin. It is one of the options in the control panel .. to set the name of this tag.

    Not sure what you mean on the date output. I can see the date of each post on the page.

    Here is the current code from archive.php…

    <?php include("header.php"); ?>
    <?php include ('sidebar_archive.php'); ?>
    
    <!-- BEGIN content -->
    <div id="content">
    <div id="archives">
    <div class="archive-title">
    <p>Blogs: <?php single_cat_title(); ?></p>
    </div>
        <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
        <?php /* If this is a category archive */ if (is_category()) { ?>
        <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
        <h2 class="title">Posts Tagged <strong><?php single_tag_title(); ?></strong></h2>
        <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
        <h2 class="title">Archive for <?php the_time('F jS, Y'); ?></h2>
        <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
        <h2 class="title">Archive for <?php the_time('F, Y'); ?></h2>
        <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
        <h2 class="title">Archive for <?php the_time('Y'); ?></h2>
        <?php /* If this is an author archive */ } elseif (is_author()) { ?>
        <h2 class="title">Author Archive</h2>
        <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
        <h2 class="title">Blog Archives</h2>
        <?php } ?>
    
        <?php
        if (have_posts()) :
        while (have_posts()) : the_post();
        ?>
    
        <!-- BEGIN post -->
        <div class="archive-posts"><?php the_time('m/d/y'); ?> -
            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
            </div>
        <!-- END post -->
    
        <?php endwhile; ?>
        <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?>
        <?php else : ?>
        <div class="notfound">
            <h2>Not Found</h2>
            <p>Sorry, but you are looking for something that is not here.</p>
        </div>
        <?php endif; ?>
    
    </div>
    </div>
    <!-- END content -->
    
    <?php get_footer(); ?>
    Michael

    (@alchymyth)

    Forum Moderator

    Those are all the posts in that category as of now. Shouldn’t the paginate still show up?

    no, most/all of the next/prev codes don’t show if there are no next/prev pages.

    I just tried to set it to a few other numbers (2, 5, etc)….no change on the page.

    weird,
    as the dashboard settings should control the number of posts shown.

    maybe a conflict with other plugins?
    to check this, deactivate all plugins, and when the number of posts per page follows the dashboard settings then, re-activate one plugin after the other – maybe the paginate plugin first – to see which plugin causses the issue.

    I deactivated all plugins except for the pagination plugin, but I had to reactivate the WP No Category Base plugin (http://wordpresssupplies.com/wordpress-plugins/no-category-base/) for this category listing page we are trying to get the pagination on to even work, among other things. With all other plugins still disabled, however … no pagination still.

    Does anyone know?

    Michael

    (@alchymyth)

    Forum Moderator

    can you make sure, that your test ‘condition’ is:

    – setting in dashboard to show max 5 posts per page;
    – more than 5 posts in that category archive;
    – this area in your code:

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

    modified to include the wordpress function ‘posts_nav_link()’:

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

    and then have another check if the pagination links show; maybe wait for someone in this forum to have a look as well.

    (there is a small chance that ‘WP No Category Base plugin ‘ might interfere)

    ok. done.

    -I modified the code
    -I changed the max posts per page to 5
    -There are 9 posts in the category “Daily T-Shirt Blog” which is the category being shown, as you can see on the page

    Unfortunately…..there is still no pagination. Have a look.

    http://billboardfamily.com/daily-t-shirt-blogs/

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Plugin: WP-Paginate] WP Paginate Plugin Help’ is closed to new replies.