Subscribe Form

Hi guys, I’m creating a new WP site and at the moment just need a single page with a subscribe form. I’m using the ‘coming soon’ home page template. The service I’m using is MailChimp. If I go into the settings for the subscribe form I can see an option to show the name field, but I want it to say ‘First Name’ instead of just ‘Name’. Do you know how I do this?

I’ve got the MailChimp for WP plugin so I can use the MailChimp Sign-Up Form, but that’s less customisable than the Beaver Builder Subscribe Form so would prefer to find a fix to display ‘First Name’.

Hey Ian,

Can you try adding the code below to your functions.php file, preferably on a child theme, and see if it does the trick?

// Translate the word Name on the Subscribe form module
function my_text_with_context_translations( $translated, $text, $context, $domain ) {
  if ( 'fl-builder' == $domain ) {
    if ( 'Name' == $text && 'First and last name.' == $context ) {
      $translated = 'New word for name';
    }
  }
  return $translated;
}
add_filter( 'gettext_with_context', 'my_text_with_context_translations', 10, 4 );

Ben

This worked perfectly so many thanks!

Will this code still be there if I have to update the theme, or will I have to add it each time after I update?

Hey Ian,

If you placed it on a child theme, it should still be there even after updating the parent theme.

Ben

Because it worked on the child theme I then went back to the normal theme and updated that. So when there is a theme update in future will I need to modify it each time?

Also do you think this feature could be included in a future BB update so we can change the text in the subscribe form?

Hi Ian,

You should refrain from editing the functions.php file in the parent theme i.e. BB Theme. As it may well cause issues, I highly recommend you remove those changes and revert the file back to it’s default self.

Then add that code if you haven’t already to your child themes functions.php file. Also, the purpose of a child theme is to inherit from the parent, but allow you to override and be safe from updates. Add that code to the parent BB theme will be removed each time you update to the latest version.

For more information on child themes, see this article on the WordPress Codex.

In regards to your suggestion, is it possible to add that to our UserVoice, please. As it is a great idea.

https://wpbeaverbuilder.uservoice.com/forums/270594-general

Thanks,
Danny

Hi Danny, thanks for the info. I went back into the parent theme and removed the text I added to the functions.php file, so now only my child theme is edited and this is now activated.

I’ve also submitted my suggestion to UserVoice.

I had a quick read of the info on that link you provided. So am I right in my understanding that when the parent theme is now updated in future, the child theme will also have the updates but will retain any changes I’ve made?

Hey Ian,

The child theme simply uses the parent theme’s files, unless you place one on your child theme, then it overrides the parent theme’s. The only exception are the functions.php and styles.css files. Any codes inside those files on your child theme will be added on top of your parent theme’s, instead of overriding it. :slight_smile: You should be good to go!

Ben

Perfect. Thanks for the info

No worries at all, Ian! Enjoy BB! :slight_smile:

Ben