Forums › Forums › Search & Filter Pro › wp_pagenavi for Yoast breadcrumb
Tagged: pagination
- This topic has 6 replies, 3 voices, and was last updated 7 years, 11 months ago by Anonymous.
-
Anonymous(Private) November 7, 2016 at 8:54 pm #69113
Hi!.
I want to replace the default navigation from the wp_pagenavi plugin to the Yoast breadcrumb,
They use this code:
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
It is possible to do it?
Thanks.Ross Moderator(Private) November 8, 2016 at 6:47 pm #69278Hey Rai
Can you show me an example page (of the current state) and explain again sorry?
Not quite sure I follow… The only time wp_page_navi is used in S&F is when displaying results using a shortcode.
To modify this template and make your code change you would follow the instructions here:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_ResultsHowever, I feel like I may be missing the point!
Best
Anonymous(Private) November 9, 2016 at 12:16 am #69336Hi Ross,
Totally sorry!, my fault. I mix two things that are not related.
Ok, so what I want to achieve is to paginate the results, like: page 1, 2, 3, 4 and like that when pagination is need it. So I find on the results.php this code that works with wp_pagenavi plugin but I´m using
<?php if ( function_exists('wp_bootstrap_pagination') ) wp_bootstrap_pagination(); ?>
Any way to make it work?, why it works just with wp_pagenavi?.
Thanks.
Ross Moderator(Private) November 16, 2016 at 9:23 pm #70771Hey Rai sorry for the delay.
If you take a look at the code from our results.php:
wp_pagenavi( array( 'query' => $query ) );
You see we are passing in the query, this is necessary so wp_pagenavi knows that it working with a specific query rather than the global $WP_Query.
I had a quick look at the plugin you were using
wp_bootstrap_pagination
–I see it is possible to pass a
custom_query
argument to it.. something like:$args = ( 'custom_query' => $query ); wp_bootstrap_pagination($args);
I’m hoping this will work, however I’m not too familiar with that plugin, it might be best to ask them how to use their plugin with a custom query…
I do see one potential point of problem though, and that is this line (26):
$page = intval( get_query_var( 'paged' ) );
That plugin is setting the current page variable with
get_query_var
which uses the global query, which in this case will cause errors.EDIT: In fact I’ve just submitted an issue over there recommended the code change:
https://github.com/talentedaamer/Bootstrap-wordpress-pagination/issues/10Hope that helps!
-
AuthorPosts