Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

[SOLVED] Exclude sidebar for logged-in user


  #1  
Old Oct 24, 2010, 08:11 AM
everyman
 
79 posts · Nov 2009
Philadelphia
Jugglead,

first of all you are a star of this forum -- I just sent you a small token of appreciation.

I saw your earlier reply to a question about how to reverse the include/exclude logic for sidebar inclusion (ie. to have the "exclude sidebar on pages X" become "include sidebar on pages X". My question a bit different, I want to EXCLUDE the sidebar for all logged-in users (it's a membership site and for non-logged in users I want to show advertisements). I would setup a right sidebar for all my posts and then tweak that with a

if(... && !is_user_logged_in() ) {
Show the sidebar...

I am hoping you can point me in the right direction

thanks!
__________________
Marc Beneteau - Get your free eBook and video
"WordPress Quick Start: Your first site in 2 hours"
http://wpacademy.tv
  #2  
Old Oct 24, 2010, 08:14 AM
everyman
 
79 posts · Nov 2009
Philadelphia
Forgot to include link to earlier post

http://forum.bytesforall.com/showthread.php?t=863
__________________
Marc Beneteau - Get your free eBook and video
"WordPress Quick Start: Your first site in 2 hours"
http://wpacademy.tv
  #3  
Old Oct 24, 2010, 01:14 PM
juggledad's Avatar
juggledad
 
23,632 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Edit the lines (389, 400, 411 and 422) in bfa_get_options.php and change them from
HTML Code:
		if ( $bfa_ata['leftcol_on']['page'] AND !in_array($current_page_id, $pages_exlude_left) ) {
HTML Code:
		if ( $bfa_ata['leftcol_on']['page'] AND in_array($current_page_id, $pages_exlude_left) AND !is_user_logged_in() ) {
- get rid of the '!' and add teh last part.

This will cause any page mentioned in the exclude list, not to display if you are logged in.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Oct 24, 2010, 03:53 PM
juggledad's Avatar
juggledad
 
23,632 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
STB - the plugins will prevent the widgets showing, but the sidebar will still be there. You'd need the code to keep the entire sidebar from showing
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Oct 24, 2010, 06:13 PM
everyman
 
79 posts · Nov 2009
Philadelphia
thanks guys. I actually wanted to disable sidebar for logged-in users on POSTS but I found this a bit below the code you mentioned above (after a long "if"):

PHP Code:
            $cols++; $right_col "on"

and replaced it with
PHP Code:
        if (!is_user_logged_in()) {
            
$cols++; $right_col "on"
        } 
which worked nicely.

thanks for your help!
__________________
Marc Beneteau - Get your free eBook and video
"WordPress Quick Start: Your first site in 2 hours"
http://wpacademy.tv

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude category from Recent Posts in sidebar paulae Sidebars & Widgets 17 Apr 9, 2013 08:34 AM
Exclude widgets from sidebar deanw Sidebars & Widgets 2 Oct 24, 2010 07:50 AM
New Widget Area named after logged user ID thanos Sidebars & Widgets 9 Sep 13, 2010 07:15 PM
Exclude Tags for Sidebar Widgets? desktop Sidebars & Widgets 2 Mar 22, 2010 08:48 PM


All times are GMT -6. The time now is 09:02 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.