WordPress.org

Ready to get started?Download WordPress

Forums

Smarter Navigation
Plugin works fine but suddenly starts jumping without order (4 posts)

  1. francpallares
    Member
    Posted 1 year ago #

    Hi,

    I've been installing and using the plugin and it worked great until I started checking older posts.

    Then I realized that from the second homepage it didn't really follow the chronological order at all going backwards, just jumping randomly.

    So the first page is working great and part of the second but afterwards it makes nonsenses.

    Any idea what when wrong and how could I could fix it?

    Thanks in advance for your time and attention ;)

    Franc

    http://wordpress.org/extend/plugins/smarter-navigation/

  2. davedillonphoto
    Member
    Posted 1 year ago #

    I'm also noticing this problem. Once I click "view older posts" and move on to page 2 of the blog archives smarter navigation seems to skip every 2 posts. and when you go to page 3 it seems to skip every 3 posts. Seems like an issue with pagination/smarter nav.

    Need help!

  3. davedillonphoto
    Member
    Posted 1 year ago #

    Figured it out, you need to change

    'posts_per_page' => -1

    about halfway down the main.php file. This will compensate for the screwed up order.

  4. versusbassz
    Member
    Plugin Author

    Posted 1 year ago #

    Or replace this:
    line 136 of main.php

    $next_posts = self::get_posts( array(
    			'_sn_post' => get_queried_object(),
    			'_sn_op' => $previous ? '<' : '>',
    			'order' => $previous ? 'DESC' : 'ASC',
    			'posts_per_page' => 2,
    		) );

    on this:

    $next_posts = self::get_posts( array(
    			'_sn_post' => get_queried_object(),
    			'_sn_op' => $previous ? '<' : '>',
    			'order' => $previous ? 'DESC' : 'ASC',
    			'posts_per_page' => 2,
    			'paged' => 1
    		) );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic