Site logo

Archived topic

Custom"load more" button

3 replies · Started by Ginaphi on December 9, 2020

Viewing posts 1–4 of 4

Hi there,

The load more text is a setting in the Customizer - not sure if Polylang has an option to translate those directly?

If not, you can filter the value like this:

add_filter( 'option_generate_blog_settings', function( $settings ) {
    $settings['masonry_load_more'] = 'Your load more value';
    $settings['masonry_loading'] = 'Your loading text value';

    return $settings;
} );

Hope this helps :)

Thank you for the answer. this is what i try to do.

// register custom word to polylang translation in admin
add_action('init', function() {
  pll_register_string('pll_load_more', 'Load More');
  pll_register_string('pll_loading', 'Loading');
});

// infinite post load more ajax button to set as multilingual polylang
add_filter( 'option_generate_blog_settings', function( $settings ) {
	$settings['masonry_load_more'] = pll('Load More');
	$settings['masonry_loading'] = pll('Loading');

	return $settings;
} );

Awesome, looks good!

This archived topic is closed to new replies.