PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Blocking widgets on homepage only?

s2Member Plugin. A Membership plugin for WordPress®.

Blocking widgets on homepage only?

Postby mobodojo » July 2nd, 2010, 12:01 pm

Here one that looks like it's one for the books, Jason :) I have a site configured to only allow access to the homepage, login, and registration elements. The site is a WP/BP site at http://www.mspboards.com and its a social networking site for IT and MSP folk. I want to be able to include the BP widebar widget which shows the avatars of all recent users, but it also shows up on the homepage where non-members can see it. Is there anyway to prevent this from happening? One of your magical URI replacements, probably?

BTW, thanks for the fantastic plugin, as it is exactly what I needed. I think you could easily claim a powerhouse hattrick by generating a version which does all of the blocking and member control, but doesn't involve any of the pay stuff. MSPBoards is open and free for all. The PayPal integration may turn some people off.

Thanks!

Tyler
User avatar
mobodojo
Registered User
Registered User
 
Posts: 1
Joined: July 2, 2010

Re: Blocking widgets on homepage only?

Postby Jason Caldwell » July 7th, 2010, 4:52 pm

Hi Tyler. Thanks for the Kudos, and great suggestions.
There are other ways around this, but my favorite solution ( most elegant I think ), is to have your theme implement two different Sidebars. In your theme file, usually inside the file "sidebar.php", you can do something like this:

register_sidebar(array ("name" => "Default Sidebar", "description" => "Visible to public."));
register_sidebar(array ("name" => "Member Sidebar", "description" => "Only for Members."));


Code: Select all
<?php

if(is_user_logged_in())
    {
        dynamic_sidebar ("Member Sidebar");
    }
else
    {
        dynamic_sidebar ("Default Sidebar");
    }
?>

Once you have that in place, you can manage everything gracefully through the Appearance -> Widgets menu in WordPress. The s2Clean Theme works like this. It also uses two separate menus for navigation as well.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 1 guest

cron