• Resolved Andrea

    (@licoreo)


    Hello
    i have a problem with pagination, if i search a term with multiple page, some pages have different number of item

    any suggestions?

    thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Do you have any example links we can look at and observe this behavior for?

    Thread Starter Andrea

    (@licoreo)

    the problem was multilingual search, i add a language and now it works, thank you

    add_filter( ‘algolia_search_params’, ‘algolia_search_params’,20,1);
    add_filter(‘algolia_searchable_post_shared_attributes’, ‘algolia_shared_attributes’, 12, 2);

    function algolia_shared_attributes( $attributes, $post)
    {
    $attributes[‘lang’] = apply_filters( ‘wpml_post_language_details’,null, $post->ID )[‘language_code’] ;

    return $attributes;
    }

    public function algolia_search_params( $params )
    {

    $params[‘facetFilters’]= [
    ‘lang:’.ICL_LANGUAGE_CODE,
    ];
    return $params;
    }

    and i add on algolia page lang as facet

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘weird pagination’ is closed to new replies.