WordPress.org

Ready to get started?Download WordPress

Forums

WP-Paginate
[resolved] WP Paginate Plugin Help (23 posts)

  1. martinfamily2005
    Member
    Posted 3 years ago #

    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/

  2. mmjaeger
    Member
    Posted 3 years ago #

    maybe this<? get_footer(); ?> vs.<?php get_footer(); ?> - depends on your configuration whether shortcode is supported or not.

  3. martinfamily2005
    Member
    Posted 3 years ago #

    fixed that.....but still does not work.

  4. Eric Martin
    Member
    Plugin Author

    Posted 3 years ago #

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

    -Eric

  5. martinfamily2005
    Member
    Posted 3 years ago #

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

  6. martinfamily2005
    Member
    Posted 3 years ago #

    Anyone?

  7. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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?

  8. martinfamily2005
    Member
    Posted 3 years ago #

    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.

  9. Eric Martin
    Member
    Plugin Author

    Posted 3 years ago #

    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...

  10. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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.

  11. martinfamily2005
    Member
    Posted 3 years ago #

    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(); ?>
  12. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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.

  13. martinfamily2005
    Member
    Posted 3 years ago #

    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.

  14. martinfamily2005
    Member
    Posted 3 years ago #

    Does anyone know?

  15. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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)

  16. martinfamily2005
    Member
    Posted 3 years ago #

    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/

  17. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    thank you for setting this up.

    what strikes me as very odd, is that still all nine posts are shown by the loop.
    and i cannot see any custom query changing this in your archive code.

    there must be something overwriting the dashboard settings - that is beyond my possibilities to check with a remote-diagnosis.

    last try: indrease the number of posts to well over ten, and check again.

  18. martinfamily2005
    Member
    Posted 3 years ago #

    Changed the max # of posts to 25 ..... no change. This is nuts. If you are open to it, I can create a temporary admin username and password so you can take a look at the settings. I can do the same on the server so you can see all of the actual wordpress files. I am completely baffled....there will be hundreds of posts so pagination is a must. Let me know, thanks.

    Email me at contact@billboardfamily.com if you want to try that

  19. martinfamily2005
    Member
    Posted 3 years ago #

    User info created and e-mailed to you. Thanks for all the help! I wish this was much simpler.

  20. martinfamily2005
    Member
    Posted 3 years ago #

    RESOLVED, thanks to alchymyth

  21. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    for the records: a plugin had overwritten the 'posts per page' setting from the dashboard.

    not the fault of 'wp-paginate'

  22. Eric Martin
    Member
    Plugin Author

    Posted 3 years ago #

    Sorry, I was out of town for a few days.

    @alchymyth - thanks for your help getting this resolved. Which plugin was it that was overwriting the value?

  23. martinfamily2005
    Member
    Posted 3 years ago #

    It was Different Posts Per Page 1.7.6

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic