• Resolved unster

    (@unster)


    Hi,
    so I have site in polish, but my shop’s urls contains “page” on 2+ page of products lists.

    I would like to translate “page” to “strona” or to remove “page” at all – but I can’t find that slug either in WP settings nor in language files of Astra theme (with Loco Translate).

    Can you please point me the place to make the translation?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter unster

    (@unster)

    Actually I did managed to solve it myself with a snippet I’ve found online.
    How it will help:

    // Translate "page" slug in pagination
    function my_custom_page_word() {
    	global $wp_rewrite;
    	$wp_rewrite->pagination_base = 'strona';
    	unset($wp_rewrite->extra_rules_top["shop/page/([0-9]{1,})/?$"]);
    	$wp_rewrite->extra_rules_top['shop/strona/([0-9]{1,})/?$'] = 'index.php?post_type=product&paged=$matches[1]';
    }
    add_action( 'init', 'my_custom_page_word' );

    ! IMPORTANT: refresh your rewrite rules in WP options afterwards.

    That’s great!

    Glad you figured it out. Thanks for letting us know.

    Also, thank you for sharing that snippet.

    If you need any further help, please do let us know.

    Regards,
    Sweta

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Translate (or remove) pagination slug in url’ is closed to new replies.