• Hey

    I notice that there is not anywhere in your backend setting to select to remove the newsletters tick box that appears in the wordpress registration form. How can I remove it?

    As it currently appears in my registration form the tick box and the “yes I would like to receive the newsletter” text are not on the same level. I have tried a lot of css to pad them into alignment but nothing is working. What is the code to move the tick box up of down, and what is the code to move the text up or down.

    I have reviewed your css file in the back end of your plugin, however there does not appear to be any references to the unique selectors for the above elements. That is, the tick box and the receive newsletter text that your plugin inserts into the WP register form.

    Thanks in advance for your kind assistance.

    Kind Regards

    Max

    https://wordpress.org/plugins/alo-easymail/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author eventualo

    (@eventualo)

    Hi, you can add your css to login/registration page using the provided hook, here are samples: https://codex.wordpress.org/Customizing_the_Login_Form

    Thread Starter khunmax

    (@khunmax)

    Hey

    Thanks for your reply.

    I do not want to style my login form.

    I want to style the check box and text that your plugin inserts into the login form.

    Can you please let me have the unique identifiers for those two items.

    Kind Regards

    Max

    There is a simple fix, just change the text instead of “Yes I would like to receive the newsletter” change it to something like “Subscribe to our newsletter (no spam)”. The original text is just a little too long.

    This can be changed in the Settings area, under Texts > Opt-in Messages

    If you really want to style, and have a single list, it should generate just this:

    <p class=”alo_easymail_reg_optin”>

    <input type=”checkbox” id=”alo_em_opt” name=”alo_em_opt” value=”yes” class=”input” checked=”checked” style=”width:auto” />

    <label for=”alo_em_opt” >Yes, I would like to receive the Newsletter (AGAIN, THIS TEXT IS CONFIGURABLE)</label></p>

    <input type=”hidden” id=”alo_em_lang” name=”alo_em_lang” value=”en” />

    Thread Starter khunmax

    (@khunmax)

    Thanks

    I did however already change the text to shorten the length: Receive Newsletter…

    But the problem is that the ticked box and the text are not on the same line.

    The box is sitting very high compared to the text.

    I was hoping to just style it or the adjacent text with some css and padding.

    Put simply, i just want to nudge the alo_em_opt up a few pixels.

    How can I do that?

    Kind Regards

    Max

    Hi @khunmax, it may be that one browser makes it look one way, but others make it appear differently. Best to test out in the most popular browsers first before (and after) tweaking.

    – Chrome and Safari on desktop
    – Chrome and Safari on mobile

    Together those are 75% (from a sample site), with Firefox on the desktop another 10%.

    See this for some idea of how to tweak the position of these elements: http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers

    Plugin Author eventualo

    (@eventualo)

    Khunmax, you can remove the checkbox margin and align checkbox and label, using the following code:

    function my_login_styles () { ?>
    	<style type="text/css">
    		#alo_em_opt {
    			margin: 0 6px 0 0;
    		}
    	</style>
    <?php }
    add_action( 'login_enqueue_scripts', 'my_login_styles' );

    For more css tips, you can follow the link provided by jeffmcneill.
    After you write your css, you can use my php sample to add styles to register screen.

    Thread Starter khunmax

    (@khunmax)

    Thanks very much for your reply and the code.

    I have checked across all browsers (ie,ff,ch,and) and the problem remains the same. I have also checked it across a styled login and the native WP format. It is not a cross browser issue.

    Isn’t the problem that there is just not enough margin set for the top of the em_opt?

    I will try your code with: margin:8px 6px 0 0;

    I think that should do it.

    HOWEVER, I am unclear as to where I need to insert the code you have provided.

    Do I insert it into the bottom of the alo-easymail.php file that appears alongside your read me file?

    Thanks in advance for your assistance.

    Kind Regards

    Max

    Thread Starter khunmax

    (@khunmax)

    Hi eventualo

    I just pasted your code exactly as you provided above into the bottom of the alo-easymail.php file and the checkbox now aligns perfectly with the “receive newsletter” text across all browsers.

    Thanks for that.

    Is there a code snippet to remove the receive newsletter checkbox completely from the registration form?

    And any chance that could be included as an option in the back end settings for the plugin.

    Kind Regards

    Max

    Thread Starter khunmax

    (@khunmax)

    Hi I just created a plugin to run your snippet. Works great.

    Any chance you will be including it in your next update so I can do away with my homemade plugin?

    Kind Regards

    Max

    @khunmax if you change the list to “admin only” then it won’t be a visible checkbox, but only a subscribe/unsubscribe radio button.

    Note: I don’t have the problem with checkbox alignment that you have so the problem can’t be for everyone. Maybe this setting could be added as an option in the settings area rather than changed for everyone?

    Thread Starter khunmax

    (@khunmax)

    @jeffmcneil: not sure you are talking about the same checkbox. The one I am referring to is that which appears alo inserts into the WP registration form, not one created on a page using shortcode.

    Hi @khunmax, yeah I got confused about what you wanted to do.

    To remove from all reg forms just add these lines in your theme’s functions.php:

    // remove the newsletter subscribe function from user registration form
    remove_action(‘register_form’,’alo_em_show_registration_optin’ );
    remove_action( ‘user_register’, ‘alo_em_save_registration_optin’ );

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Styling newsletter optin within registration form’ is closed to new replies.