simpliko / wpadverts

WordPress Classifieds Plugin
https://wpadverts.com/
GNU General Public License v2.0
20 stars 11 forks source link

Incorrect pagination for custom taxonomies #162

Closed gwin closed 1 year ago

gwin commented 1 year ago

I've just found an issue. When visiting advert_category page (/kategoria/tag-name/?pg=2)) the pagination redirects me to ogloszenie/5672/?pg=2 (the newest advert 2nd page?) instead of kategoria/tag-name/?pg=2 Could you please help me with this issue?

Sorry, it's not advert_category, but custom advert_tags created like in https://wpadverts.com/doc/data-sources-taxonomies/

Temporary solution

add_filter( "adverts_list_pagination_base", function( $pbase ) {
    if( is_tax() ) {
        $pbase = get_term_link( get_queried_object()->term_id ) . '%_%';
    }
    return $pbase;
});