Excluding S2Member from Homepage
Posted: January 26th, 2012, 8:37 am
First of all, S2Member is great! I was struggling with the easiest membership plugins out there, because they wouldn't want to work the way I needed them or were lacking important features. I am quite happy with free s2member and all the video tutorials. This is great!
However (now here is the sad part), s2member slows my site down very much. I could save some loading by using w3totalcache and jQuery lazy load. You can see it for yourself on http://dazugelernt.de
Here's my question / idea:
Since the Homepage is the most important page for any user to see, it should load very quickly. Also, since the user does not yet have to be logged in, the loading of any s2member scripts is obsolete then. When I am not yet linking to any protected content on my site, this should not be a problem.
How can I exclude s2member from being loaded into the <head> when a user is not logged in? I know it should work like this (probably I've made some mistakes there):
Can you help me put this to work?
Cheers,
Alex from Germany
However (now here is the sad part), s2member slows my site down very much. I could save some loading by using w3totalcache and jQuery lazy load. You can see it for yourself on http://dazugelernt.de
Here's my question / idea:
Since the Homepage is the most important page for any user to see, it should load very quickly. Also, since the user does not yet have to be logged in, the loading of any s2member scripts is obsolete then. When I am not yet linking to any protected content on my site, this should not be a problem.
How can I exclude s2member from being loaded into the <head> when a user is not logged in? I know it should work like this (probably I've made some mistakes there):
- Code: Select all
<?php
if ( array (is_front_page(), is_user_logged_in() ) ) {
insert s2member in the header
} else {
do nothing
}
?>
Can you help me put this to work?
Cheers,
Alex from Germany