Search pagination

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 10 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7043

    I reached out a little while ago and you found that there are some pagination issues with searching from the homepage.

    You provided a fix which seems to work, but not work:

     //See http://codex.wordpress.org/Function_Reference/paginate_links
        $big = 999999999; // need an unlikely integer
        echo paginate_links( array(
            'base' => str_replace( $big, '%#%', add_query_arg( 'page_id', get_the_ID(), get_pagenum_link( $big ) ) ),
            'format' => '?paged=%#%',
            'current' => max( 1, get_query_var( 'paged' ) ),
            'total' => $eo_event_loop->max_num_pages
        ) );
    

    The generated pagination links are correct, but there are two issues:

    1. If I am using a postname permalink structure, the ?page_id=77 is getting instantly removed on page request. Could this be an .htaccess issue?

    2. If I use a default permalink structure, the first pagination link I click on works great, but while on that new page, the ampersand in the pagination links gets replaced with it’s #038; counterpart (thus not working). You can see an example of this at http://events.greatlakesbaymag.com/

    This is literally the very last piece/problem to this site I’ve been working on. After this I’m launching it. I would owe you HUGE if I could get this fixed.

    Thanks!

    John

    John Riordan
    #7048

    A heads up other other users – pagination with the event search shortcode on the home page seems to experience some issues. This being worked on, and this thread relates to an attempt to work-around the issue inthe mean time. The original bug relates to using the [event_search] shortcode on a page which is used as the static home page.


    Hi John, I’ll send you an email after posting this – if the following doesn’t work, then I might need admin access to test things myself, but hopefully the code below will resolve it for you:

     //See http://codex.wordpress.org/Function_Reference/paginate_links
        $big = 999999999; // need an unlikely integer
        echo paginate_links( array(
            'base' => str_replace( $big, '%#%', add_query_arg( 'page_id', get_the_ID(), get_pagenum_link( $big, false ) ) ),
            'format' => '?paged=%#%',
            'current' => max( 1, get_query_var( 'paged' ) ),
            'total' => $eo_event_loop->max_num_pages
        ) );
    

    The change being adding false as a second argument to get_pagenum_link().

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.