WordPress.org

Ready to get started?Download WordPress

Forums

WP No Category Base - WPML compatible
[resolved] SOLUTION to fix category pagination 404 error (9 posts)

  1. newbieee
    Member
    Posted 2 years ago #

    Hi,

    if you are using custom pagination_base i.e. you don't have /page/2/ but for example /strana/2 (Czech translation of 'page') and you would like this plugin to work even for paged categories ( http://www.domain.com/my_cutom_category/strana/2/ ), you need to edit a line in no-category-base-wpml.php inside the .ZIP file.

    THIS:
    $category_rewrite['('.$category_nicename.')/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';

    TO:
    $category_rewrite['('.$category_nicename.')/'.$wp_rewrite->pagination_base.'/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';

    AND GRAB (it's a few lines below):
    global $wp_rewrite;
    AND PUT IT SOMEWHERE BEFORE THE
    foreach($categories as $category) {

    That's it. If plugin author is willing to make a change in the plugin, it would be for the best..

    http://wordpress.org/extend/plugins/no-category-base-wpml/

  2. mines.io
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for sharing newbieee. I will take a look at it and change the plugin if it doesn't break other setups.

  3. Hunreal
    Member
    Posted 2 years ago #

    newbieee!!!

    Thanks a lot!! You are the BEST!!!!! :) My problem is solved! :)

  4. mines.io
    Member
    Plugin Author

    Posted 2 years ago #

    Hello all,

    I've added support for custom pagination_base on the development version of the plugin, which is available at:

    http://downloads.wordpress.org/plugin/no-category-base-wpml.zip

    If there are no issues with it, I will soon update the stable version to merge this fix.

    Thanks.

  5. Turismo in
    Member
    Posted 1 year ago #

    Please,
    i've done this modify but i have ever the same problem:

    Error 404 when i click /page/2/ in the category.

    I have last wp, this plugin, w3tc and wpml. Please can help me?

  6. mines.io
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Have you installed the last development version?

  7. Turismo in
    Member
    Posted 1 year ago #

    WordPress 3.4.2
    Wordpress seo 1.2.8.5
    WP No Category Base - WPML compatible 1.1.0 and i have tried also this code in this page

  8. Turismo in
    Member
    Posted 1 year ago #

    Yes now works, in my case:

    Refresh settings / permalinks and after works!!!!!!

  9. mines.io
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic