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:
-
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?
-
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
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