Forum Replies Created
-
That clears it up. Thanks!
One more thing to remember if you do this – the HTML you place for non-logged-in users needs to represent a full HTML page with all the tags, like the HTML, HEAD, BODY tags, etc, because non-logged-in users will only see what’s above the “else”.
For hotdvl666 – You could start by, say, creating a copy of the index.php file from the bp-default theme folder, and placing that into your Unplugged theme folder. This will over-ride the original.
You could then add the following to the top of the index.php copy you placed in your theme’s folder:
<?php if (!is_user_logged_in()) { ?>
Place HTML you want non-logged-in users to see here.
<?php } else { ?>Then on the last line of your copy, you just have to close the if … else statement:
<?php } ?>
That seems to me like a good starting place. It basically just says, if the user is not logged in, I’m gonna display the HTML you enter, otherwise, I’m gonna do the normal theme thing to do. This is minimally invasive and should work fine. If it breaks something, just remove the index.php copy from your theme’s folder.
yeah … you can do a lot with that sort of thing if you just take a bit of time to learn it. This little tutorial really opened my mind to the possibilities – Frontend Admin Menu in WordPress – That guy’s website is great. Lots to learn.
Depending on how comfortable you are with code, you can use conditional tags, if statements, and includes to do just about anything you want. I have several custom headers in my theme that load up depending on what kind of page is being displayed. You could have different template files (and thus, entirely different looking pages) load based on whether or not a user is logged in, and also what level of user is logged in.
For example, you could place the following in your header.php file:
<?php if (is_user_logged_in() && current_user_can('level_2') && !current_user_can('level_8')) {
include (TEMPLATEPATH . 'path to custom header file 1');
} elseif (is_user_logged_in() && current_user_can('level_8')) {
include (TEMPLATEPATH . 'path to custom header file 2');
} elseif (is_user_logged_in()) {
include (TEMPLATEPATH . 'path to custom header file 3');
} elseif (!is_user_logged_in()) {
include (TEMPLATEPATH . 'path to custom header file 4');
} ?>This basically says, if the person looking at the site is a logged-in user AND they are an author AND they are not admin, load template file 1. If the person is logged in AND is admin, load template file 2. If the person is any other type of logged in user, load template file 3. If the person is not logged in, load template file 4.
I have been doing this sort of thing on my site with great results, but again, it does require a bit of tinkering with the template files and a certain comfort level with code.