Pagination not working with custom search slug
- prakashreddy.imduriParticipant1 year, 11 months ago #31078
Hi, I have a custom slug domain.name/search/?s= to my search page, All features are working but pagination is not working with this slug, but its working with domain.name/?s= . Can you help me to fix the issue for pagination?
prakashreddy.imduriParticipant1 year, 11 months ago #31082we are using this function for slug rewrite
function wpb_change_search_url() {
if ( is_search() && ! empty( $_GET[‘s’] ) ) {
wp_redirect( home_url( “/search/” ) . urlencode( get_query_var( ‘s’ ) ) );
exit();
}
}
add_action( ‘template_redirect’, ‘wpb_change_search_url’ );Ajax is getting sent, but still no results or page number is changing
prakashreddy.imduriParticipant1 year, 11 months ago #31086All css selectors are fine, bcos the ajax and pagination is working without that function wpb_change_search_url()
prakashreddy.imduriParticipant1 year, 11 months ago #31089there is no page for it in backend , its just an url rewrite for the wordpress search functionalityz. we are not using any shortcode. the function just adds /search/ to ?s in url…
its a custom slug for wordpress default searchprakashreddy.imduriParticipant1 year, 11 months ago #31092I just wanted to display search url as domain.name/search/?s= instead of the default domain.name/?s=, That function worked, but only problem is the pagination when /search/ is present in url.
prakashreddy.imduriParticipant1 year, 11 months ago #31096the same code is working without any issue without wpsolr, but after activating plugin, there is pagination issue. Can you try this and let me know
function wpb_change_search_url() {
if ( is_search() && ! empty( $_GET[‘s’] ) ) {
wp_redirect( home_url( “/search/” ) . urlencode( get_query_var( ‘s’ ) ) );
exit();
}
}
add_action( ‘template_redirect’, ‘wpb_change_search_url’ );prakashreddy.imduriParticipant1 year, 11 months ago #31106How can I make this url work : /store/?s= to /store/search/?s=
Can you pls guide
You must be logged in to reply to this topic.