Skip to content

Snippet: Custom Load More Settings

Important: This snippet only changes the default arguments for the load more function used in theme Elements and not the load more function used in archives when using the default template display.

Here is an example on how to change the load more settings for any Total WPBakery module with load more functionality. Simply change "vcex_testimonials_grid" to the module you are using (ask if you aren't sure the correct name - it's the shortcode name).

// Change load more button for the testimonials grid module
add_filter( 'vcex_get_loadmore_button_settings', function( $settings, $base, $atts ) {
	if ( 'vcex_testimonials_grid' == $base ) {
		$settings['text']         = esc_html__( 'Custom Load More', 'total-theme-core' );
		$settings['loading_text'] = esc_html__( 'Custom Loading...', 'total-theme-core' );
		$settings['failed_text']  = esc_html__( 'Custom Failed to load posts.', 'total-theme-core' );
	}
	return $settings;
}, 10, 3 );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top