• Resolved jeffreyhxm

    (@jeffreyhxm)


    I’m showing a bunch of post on a page using WP_Query() in my mapped domain and then using paginate_links() to show the pagination. When I click on the pagination links I’m getting redirected back to page 1.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author matthias.wagner

    (@matthiaswagner)

    hy jeff,

    please post a link to the page so we can see how the urls look and see if we can reproduce it.

    matt

    Thread Starter jeffreyhxm

    (@jeffreyhxm)

    On this development site we have several pages of posts that paginate well here: http://da2017.lugerun.com/education-library/

    On our mapped domain, we have the same content being shown but the pagination keeps redirecting back to page 1:
    http://reeseharper.lugerun.com/for-dentists/education-library/

    Here’s the php outputting the pagination:

    <?php
    	$args['prev_text'] = '<i class="fa fa-angle-left" aria-hidden="true"></i>';
    	$args['next_text'] = '<i class="fa fa-angle-right" aria-hidden="true"></i>';
    	$args['type'] = 'list';
    	$args['current'] = max( 1, $paged );
    	$args['total'] = $query->max_num_pages;
    	// $args['base'] = 'http://reeseharper.lugerun.com/for-dentists/education-library/%_%';
    	echo paginate_links( $args );
    ?>

    As you can see, I tried setting the “base” argument to be the mapped domain, but that wasn’t working so I commented it out. Also, just adding the pagination variable to the URL doesn’t work either:

    http://reeseharper.lugerun.com/for-dentists/education-library/?paged=2

    Plugin Author matthias.wagner

    (@matthiaswagner)

    hy jeff,

    thanks for sharing your code. i tried “paginate_links” in our testing environment (with twenty seventeen theme) and it worked without any args. would you like to share a screenshot of your mapping as well, maybe something there is weird?
    you could also try “the_posts_pagination” function.

    matt

    Thread Starter jeffreyhxm

    (@jeffreyhxm)

    I tried “the_posts_pagination” function but nothing appeared on either domain. In the documentation it looks like that might only work for index and archive pages. I’m outputting posts on a custom post type page that I gathered via WP_Query(). Interestingly, the following code worked on the main domain, but didn’t show up on the mapped domain:

    <?php echo get_next_posts_link( 'Next Page', $query->max_num_pages ); ?>
    <?php echo get_previous_posts_link( 'Previous Page' ); ?>

    Mappings Screenshot:
    https://www.dropbox.com/s/6jo21233h6fh94s/Screenshot%202018-01-09%2010.08.38.png?dl=0

    Settings Tab Screenshot (looks like there are some errors):
    https://www.dropbox.com/s/8mamq691xpezzmx/Screenshot%202018-01-09%2010.10.08.png?dl=0

    Plugin Author matthias.wagner

    (@matthiaswagner)

    hy jeff,

    ok i think you should forget about mapping first and set up the pagination on the original domain. because when i visit http://da2017.lugerun.com/rh/reese-harper/for-dentists/education-library/ and try pagination there, it is not working either…

    -> deactivate mapping plugin and see what is the problem with pagination
    -> after that, activate again and see if it works. otherwise just come back here 😉
    -> the settings tab notices are no problem. it is just a bit messy in our code at that place and you seem to have debug-mode enabled.

    matt

    Thread Starter jeffreyhxm

    (@jeffreyhxm)

    Matt,

    It looks like the issue is with WordPress and while googling this morning I couldn’t find a fix. Pagination on a custom post type page showing other posts via wp_query doesn’t seem to work. I’ve had to restructure the site to get the “mapped domain” to use regular WordPress pages and not custom post type pages. Thanks for your help and for the plugin!

    BTW, I’d prefer this dev site not be indexed by search engines. Could we remove this support thread?

    Plugin Author matthias.wagner

    (@matthiaswagner)

    hy jeff,

    glad to hear you found a solution 🙂 all the links here have rel=”nofollow” and you can set the robots tag too on your pages if you like. as it is helpful for other users, i’d prefer not to delete the thread.

    matt

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problems with Pagination’ is closed to new replies.