• Anonymous User 14250358

    (@anonymized-14250358)


    Hi,

    How can I change the “Subscribe to Newsletter/s” text. This is not suitable for all applications and should be an editable field. Please consider that fucntion, in the meantime, please let me know how I can change this.

    Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • wordpresstikweb

    (@abdultikweb)

    Hello, to change this text, go to WooCommerce > Settings > MailPoet & change Subscribe checkbox label

    Thanks

    Thread Starter Anonymous User 14250358

    (@anonymized-14250358)

    Thanks, but maybe you didnt understand my question.

    Your suggestion only changes the sub heading, and I have already set that in the location you suggested. I also need to change the Subscribe to Newsletter heading which is located above the one you suggested.

    Thanks.

    Thread Starter Anonymous User 14250358

    (@anonymized-14250358)

    I think you have it hard coded in ‘class-mpwa-frontend-fields.php’

    <?php else: ?>
    <h3><?php $this->_e( ‘Subscribe to Newsletter’ ); ?></h3>
    <?php

    Please make this user customizable content in the Admin side. If I edit your plugin files they will be overwritten in updates.

    Thanks.

    wordpresstikweb

    (@abdultikweb)

    Alternatively, simply add this function to your child theme’s functions.php to replace “Subscribe to Newsletter” text to other

    function start_modify_html() {
    	ob_start();
    }
    
    function end_modify_html() {
    	$html = ob_get_clean();
    	$html = str_replace( 'Subscribe to Newsletter', 'My custom text', $html );
    	echo $html;
    }
    
    add_action( 'wp_head', 'start_modify_html' );
    add_action( 'wp_footer', 'end_modify_html' );

    Thanks

    Thread Starter Anonymous User 14250358

    (@anonymized-14250358)

    Great, Ill give that a shot.

    Thanks!

    Thread Starter Anonymous User 14250358

    (@anonymized-14250358)

    I tried your function, but it doesnt work if I use the Before submit position.

    That is the position I want to use.

    Do you have any idea?

    wordpresstikweb

    (@abdultikweb)

    Hello, please replace that code with this:

    function change_sub_text( $sub_text ) {
    	if ( $sub_text == 'Subscribe to Newsletter' ) {
    		$sub_text = 'My custom text';
    	}
    	return $sub_text;
    }
    add_filter( 'gettext', 'change_sub_text', 20 );

    Thanks

    Thread Starter Anonymous User 14250358

    (@anonymized-14250358)

    Works well, thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Changing Subscribe text.’ is closed to new replies.