Community Support Forums — WordPress® ( Users Helping Users ) — 2011-05-04T22:53:42-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=6313 2011-05-04T22:53:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6313&p=14154#p14154 <![CDATA[Re: Custom Header Output?]]>
10-4 on the .js file being needed. I think I'll just leave both as-is as it's not crucial for me, I just like to run header info on the pages that need it only (as much as possible).

Thanks again for your help Jason :)

Statistics: Posted by AlxRam — May 4th, 2011, 10:53 pm


]]>
2011-05-04T22:05:06-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6313&p=14150#p14150 <![CDATA[Re: Custom Header Output?]]>
Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code:
<?php
add_action 
("ws_plugin__s2member_after_loaded", "remove_s2_pro_css");
function remove_s2_pro_css ()
    {
        remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_css_js::css");
    }
?>
* This works for CSS only. You can't do this with s2Member's JS file, it would break Pro Form functionality and other areas of s2Member as well. The JavaScript library is required to operate s2Member.


If you'd like to ONLY remove the CSS for specific
Payment Gateway integrations, you can do it like this instead.
Code:
<?php
add_action 
("ws_plugin__s2member_after_loaded", "remove_s2_pro_css");
function remove_s2_pro_css ()
    {
        remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_alipay_css_js::alipay_css");
        remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_authnet_css_js::authnet_css");
        remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_ccbill_css_js::ccbill_css");
        remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_clickbank_css_js::clickbank_css");
        remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_google_css_js::google_css");
        remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_paypal_css_js::paypal_css");
    }
?>

@TODO: update the official documentation to make this clear.
100% Completed ( coming in the next release )

Statistics: Posted by Jason Caldwell — May 4th, 2011, 10:05 pm


]]>
2011-05-04T20:23:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6313&p=14144#p14144 <![CDATA[Re: Custom Header Output?]]>
Cristián Lávaque wrote:
From the FAQs http://www.s2member.com/support/

How can I prevent s2Member Pro from loading it's default CSS?

You can place this into the functions.php file for your WordPress® theme.

Code:
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_css_js::css");
 


Or, you could remove only specific action Hooks; based on Payment Gateway.

Code:
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_alipay_css_js::alipay_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_authnet_css_js::authnet_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_ccbill_css_js::ccbill_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_clickbank_css_js::clickbank_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_google_css_js::google_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_paypal_css_js::paypal_css");
 



I haven't tried it, but it's probable that it'll work for JavaScript if you change the css at the end for js. Let me know if it works. :)


Hmmm, strange. That code isn't removing either from the header. I'll keep playing with it some more and see if I can find the problem... this is what I put in functions.php

Code:
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_css_js::css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_css_js::js");


Also tried with apostrophes instead of quotes like this:

Code:
remove_action ('ws_plugin__s2member_during_css', 'c_ws_plugin__s2member_pro_css_js::css');
remove_action ('ws_plugin__s2member_during_css', 'c_ws_plugin__s2member_pro_css_js::js');

Statistics: Posted by AlxRam — May 4th, 2011, 8:23 pm


]]>
2011-05-04T20:12:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6313&p=14143#p14143 <![CDATA[Re: Custom Header Output?]]> http://www.s2member.com/support/


How can I prevent s2Member Pro from loading it's default CSS?

You can place this into the functions.php file for your WordPress® theme.

Code:
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_css_js::css");
 


Or, you could remove only specific action Hooks; based on Payment Gateway.

Code:
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_alipay_css_js::alipay_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_authnet_css_js::authnet_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_ccbill_css_js::ccbill_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_clickbank_css_js::clickbank_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_google_css_js::google_css");
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_paypal_css_js::paypal_css");
 



I haven't tried it, but it's probable that it'll work for JavaScript if you change the css at the end for js. Let me know if it works. :)

Statistics: Posted by Cristián Lávaque — May 4th, 2011, 8:12 pm


]]>
2011-05-04T20:02:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6313&p=14142#p14142 <![CDATA[Re: Custom Header Output?]]>
I see the code example for removing the css:
remove_action ("ws_plugin__s2member_during_css", "c_ws_plugin__s2member_pro_css_js::css");

Can I use a similar action to remove the javascript file?

Statistics: Posted by AlxRam — May 4th, 2011, 8:02 pm


]]>
2011-05-04T19:59:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6313&p=14141#p14141 <![CDATA[Custom Header Output?]]>
So basically I'm looking for an example of how to:

1. Remove s2member css and javascript using functions.php
2. Then add s2member css and javascript to 2 template files only

I don't know if it's possible that way... any other suggestions would also be appreciated.

Thanks :)

Statistics: Posted by AlxRam — May 4th, 2011, 7:59 pm


]]>