Page 1 of 1

s2Member Overrides CSS

PostPosted: February 9th, 2011, 12:15 pm
by PxO Ink
Hi,

I'm just getting started with s2Member and I'm wondering how I can stop s2Member from overriding registration/login CSS. It states in the s2Member panel that modifying CSS is required, however, if possible I would like to retain the CSS used in my theme globally. I did do a search, and found a similar topic that did not quite help me: viewtopic.php?f=4&t=1998&p=6178&hilit=CSS#p6178

If anyone has any ideas, that would be great. I did try to send an email through support for unrelated questions/concerns. As I have not received any sort of response in many days, I figured it would be best to post my questions here from now on.

Re: s2Member Overrides CSS

PostPosted: February 11th, 2011, 10:23 am
by PxO Ink
I went ahead and sent another support email, but once again it was ignored. I'm wondering if anyone can help me adjust s2Member to compensate for overriding CSS.

Well, I figured it out. I think. Here's the code you add to functions.php:

remove_action("login_head", "ws_plugin__s2member_login_header_styles");

Re: s2Member Overrides CSS

PostPosted: February 21st, 2011, 8:16 pm
by tristrella
Hi,

I also have the same problem, my homepage is entirely broken when users are not logged in.
I do tried adding remove_action("login_head", "ws_plugin__s2member_login_header_styles"); on theme functions, but the login page is reverted back to the default wordpress login style.
Any help?

Re: s2Member Overrides CSS

PostPosted: February 27th, 2011, 7:36 pm
by peteratomic
Tristrella - I had the same problem, but I started using the Theme My Login plugin which skips going to the main WP login page. An alternative...

Hopefully in a future version they'll stop writing styles that takes over the whole site!

Re: s2Member Overrides CSS

PostPosted: February 27th, 2011, 7:45 pm
by peteratomic
SPOKE TOO SOON! Just did an upgrade and this code no longer works! They must have changed the coding or something because this PxO's code doesn't work anymore. :((

Re: s2Member Overrides CSS

PostPosted: March 24th, 2011, 6:09 am
by thoughton
I've had this same problem, and at first glance I appear to have 'fixed' it by simply commenting out all of the CSS code in plugins/s2member/includes/classes/login-customizations.inc.php

I commented out this whole block:

Code: Select all
               $s .= 'html, body { border: 0' . $i . '; background: none' . $i . '; }' . "\n"; /* Clear existing. */
                  $s .= 'html { background-color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . $i . '; }' . "\n";
                  $s .= 'html { background-image: url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image"] . ')' . $i . '; }' . "\n";
                  $s .= 'html { background-repeat: ' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] . $i . '; }' . "\n";
                  /**/
                  $s .= 'body, body * { font-size: ' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_size"] . $i . '; }' . "\n";
                  $s .= 'body, body * { font-family: ' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_family"] . $i . '; }' . "\n";
                  /**/
                  $s .= 'p#backtoblog a, p#backtoblog a:hover, p#backtoblog a:active, p#backtoblog a:focus { color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow: 1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; top: 15px' . $i . '; left: 15px' . $i . '; padding: 10px' . $i . '; border:1px solid #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; background-color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; }' . "\n";
                  /**/
                  $s .= 'div#login { width: ' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"] . 'px' . $i . '; }' . "\n";
                  $s .= 'div#login h1 a { background: url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"] . ') no-repeat top center' . $i . '; }' . "\n";
                  $s .= 'div#login h1 a { display: block' . $i . '; width: 100%' . $i . '; height: ' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_height"] . 'px' . $i . '; }' . "\n";
                  /**/
                  $s .= 'div#login form { -moz-box-shadow: 1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; -webkit-box-shadow: 1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; box-shadow: 1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; }' . "\n";
                  /**/
                  $s .= 'div#login p#nav, div#login p#nav a, div#login p#nav a:hover, div#login p#nav a:active, div#login p#nav a:focus { color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow: 1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; }' . "\n";
                  /**/
                  $s .= 'div#login form p { margin: 2px 0 16px 0' . $i . '; }' . "\n"; /* Handle margins. */
                  $s .= 'div#login form input[type="text"].input, div#login form input[type="password"].input, div#login form input[type="text"].ws-plugin--s2member-custom-reg-field, div#login form input[type="password"].ws-plugin--s2member-custom-reg-field, div#login form textarea.ws-plugin--s2member-custom-reg-field, div#login form select.ws-plugin--s2member-custom-reg-field { font-weight:normal' . $i . '; color:#333333' . $i . '; background:none repeat scroll 0 0 #FBFBFB' . $i . '; border:1px solid #E5E5E5' . $i . '; font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_field_size"] . $i . '; margin: 0 2% 0 0' . $i . '; padding:3px' . $i . '; width:98%' . $i . '; }' . "\n";
                  $s .= 'div#login form input[type="checkbox"].ws-plugin--s2member-custom-reg-field, div#login form input[type="radio"].ws-plugin--s2member-custom-reg-field { vertical-align:middle' . $i . '; }' . "\n";
                  $s .= 'div#login form select.ws-plugin--s2member-custom-reg-field > option { font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_field_size"] . $i . '; }' . "\n";
                  $s .= 'div#login form label.ws-plugin--s2member-custom-reg-field-op-l { vertical-align:middle' . $i . '; font-size:90%' . $i . '; }' . "\n";
                  $s .= 'div#login form select.ws-plugin--s2member-custom-reg-field { width:100%' . $i . '; }' . "\n";
                  /**/
                  $s .= 'div#login form p.submit { margin-bottom: 0' . $i . '; }' . "\n";
                  $s .= 'div#login form input[type="submit"], div#login form input[type="submit"]:hover, div#login form input[type="submit"]:active, div#login form input[type="submit"]:focus { color: #666666' . $i . '; text-shadow: 2px 2px 5px #EEEEEE' . $i . '; border: 1px solid #999999' . $i . '; background: #FBFBFB' . $i . '; padding: 5px' . $i . '; -moz-border-radius: 3px' . $i . '; -webkit-border-radius: 3px' . $i . '; border-radius: 3px' . $i . '; }' . "\n";
                  $s .= 'div#login form input[type="submit"]:hover, div#login form input[type="submit"]:active, div#login form input[type="submit"]:focus { color: #000000' . $i . '; text-shadow: 2px 2px 5px #CCCCCC' . $i . '; border-color: #000000' . $i . '; }' . "\n";
                  $s .= 'div#login form#lostpasswordform { padding-bottom: 16px' . $i . '; } div#login form#lostpasswordform p.submit { float: none' . $i . '; } div#login form#lostpasswordform input[type="submit"] { width: 100%' . $i . '; }' . "\n";
                  $s .= 'div#login form#registerform { padding-bottom: 16px' . $i . '; } div#login form#registerform p.submit { float: none' . $i . '; margin-top: -10px' . $i . '; } div#login form#registerform input[type="submit"] { width: 100%' . $i . '; }' . "\n";
                  /**/
                  $s .= 'div#login form#registerform p#reg_passmail { font-style: italic' . $i . '; }' . "\n";
                  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
                     $s .= 'p#reg_passmail { display: none' . $i . '; }' . "\n";
                  /**/


Now off to see if it's broken anything else!

PS I was already using the Theme My Login plugin prior to installing s2member Don't know if that makes any difference.

Re: s2Member Overrides CSS

PostPosted: March 26th, 2011, 1:52 am
by Jason Caldwell
Hi there. Thanks for the excellent questions.

s2Member will, by default, apply CSS to the default Login/Registration system for WordPress, allowing you to re-brand this particular section of your site ( and only this particular section ). The tools allowing you to re-brand the default Login/Registration system are found in your Dashboard under:
s2Member -> General Options -> Login/Registration Design.

Now, if you'd like to disable this functionality, you can.

Please create this directory and file:
/wp-content/mu-plugins/s2-hacks.php

Inside the file, add this code snippet.
Code: Select all
<?php
add_filter 
("ws_plugin__s2member_login_header_styles", "__return_false");
?>


@peteratomic
If in previous versions of s2Member you were using this.
Code: Select all
remove_action("login_head", "ws_plugin__s2member_login_header_styles"); 

With s2Member v3.5+, please change this to reflect s2Member's new static class method.
Code: Select all
remove_action("login_head", "c_ws_plugin__s2member_login_customizations::login_header_styles"); 


@PxO Ink, @thoughton ~ Our sincere apologies for any delays in response time. For anyone having issues getting email through to us ( i.e. not receiving a response within 24-48 hours, please try this contact form ). If you are still unsuccessful, please contact me or Cristián Lávaque directly through the forum.