Forums Forums Search & Filter Pro wp_pagenavi for Yoast breadcrumb

Tagged: 

  • This topic has 6 replies, 3 voices, and was last updated 8 years ago by Anonymous.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #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.

    Trevor
    #69149

    Hi Rai

    I suspect that it may need to be Ross that answers this, and he is very busy with the coding of the next release.

    Anonymous
    #69172

    Thanks Trevor, I will wait.

    Ross Moderator
    #69278

    Hey 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_Results

    However, I feel like I may be missing the point!

    Best

    Anonymous
    #69336

    Hi 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
    #70771

    Hey 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

    https://github.com/talentedaamer/Bootstrap-wordpress-pagination/blob/master/wp_bootstrap_pagination.php

    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/10

    Hope that helps!

    Anonymous
    #78115

    Many thanks Ross!.

    They reply to you?, I think if they don´t fix it is useless to try.

    Blessings!.

Viewing 7 posts - 1 through 7 (of 7 total)