How do I edit text on registration page

I would like to change the text “Register For This Site” on the registration page. How can I do this in S2Member Pro? Thanks for your help.

See this: Changing s2member-list empty result text

Thank you for the link. This seems to apply to a different situation. I’m wondering how to edit that specific text, ie, where to go and how to accomplish this. Thanks.

Rich, no, it doesn’t. It applies to all text in s2Member that you wish to change or edit. Please take another look.

Thanks, Tim. I’m just not sure how to get to the file I need to edit. Could you help me out there? Is there an option in S2Member Pro to edit this document? Thanks so much!

You don’t edit the document at all. Just copy and paste my code into your (child) theme’s functions.php file while replacing the text that you want to change with what is relevant to you.

I created a child theme and pasted the code into the functions.php file as follows:

<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below: if ( !function_exists( 'chld_thm_cfg_parent_css' ) ): function chld_thm_cfg_parent_css() { wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'imic_bootstrap','imic_bootstrap_theme','imic_fontawesome','imic_animations','imic_lineicons' ) ); } endif; add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 ); // END ENQUEUE PARENT ACTION function kts_text_context_changes( $translated, $original, $context, $domain ) { if ( $domain == 's2member' && $context == 's2member-front' ) { if ( $original == 'Register For This Site' ) { $translated = 'Join the Harrisburg Camera Club'; } else if ( $original == 'SOME OTHER STRING TO CHANGE' ) { $translated = 'YOUR NEW PREFERRED TEXT'; } } return $translated; // return modified text } add_filter( 'gettext_with_context', 'kts_text_context_changes', 10, 4 ); Is the code pasted in the proper place? And should I remove the else if section as I don't have anything else to put in there as there are no alternative strings to replace? And should the code be repeated for each text change I assume? Thanks again!

Yes

It’s up to you. It won’t do any harm leaving it there, in case you want to add anything later and can then easily see how it’s done. But you can certainly delete it if you prefer.

The text I’m trying to replace hasn’t changed. I made sure the child theme is activated. Any ideas? Thanks.

Ah, it looks like you are using the default WordPress registration page. That’s nothing to do with s2Member.

In that case, your code needs to look something like this:

function kts_text_changes( $translated, $original, $domain ) {
	if ( in_array( $GLOBALS['pagenow'], array( 'wp-signup.php', 'wp-register.php', 'wp-login.php' ) ) ) {
		if ( $original == 'Register For This Site' ) {
			$translated = 'WHATEVER YOU WANT';
		}
	}
	return $translated;
}
add_filter( 'gettext', 'kts_text_changes', 10, 3 );
1 Like

Thank you very much! That worked perfectly!

1 Like