0

何らかの理由で、商品カテゴリのページにページネーションがありません。他のすべてのページでは正常に機能し、製品カテゴリ ページでは欠落しています。

ページネーション テンプレートを拡張し、ショップ ページでは適切に呼び出されましたが、何らかの理由でカテゴリ ページでは呼び出されませんでした。

なぜこれが起こっているのか誰にも示唆できますか?

また、このページには約 32 の製品があり、ページの記録を破るのに十分なはずです。

前もって感謝します。

4

1 に答える 1

5

The problem was caused because the post_per_page query argument wasn't set on the archive page.

This can be solved by overriding and adding following code to your woocommerce archive (archive-product.php) page.

//Will only effect the woocommerce archive page
global $query_string;
query_posts($query_string . "&posts_per_page=12");

Or by adding following to the functions.php of your theme

 //Will effect both the woocommerce archive page and the wordpress archive page
function set_row_count_archive($query){
    if ($query->is_archive) {
            $query->set('posts_per_page', 15);
   }
    return $query;
}

add_filter('pre_get_posts', 'set_row_count_archive');

Hope this helps someone.

于 2013-06-15T07:43:15.800 に答える