Notifications
Clear all

[Solved] How to hide forum for guests

12 Posts
2 Users
7 Reactions
1,005 Views
Posts: 59
 mhit
Topic starter
(@mhit)
Estimable Member
Joined: 2 years ago

Hello,

When guests users have no access to the forum, they still see the forum 'frame' / empty forum (for example, under the Forum Admin Welcome message, if you have any, see screenshot).

Is it possible to completely hide this forum text for guests untill they are logged in?

11 Replies
Posts: 59
 mhit
Topic starter
(@mhit)
Estimable Member
Joined: 2 years ago

Maybe something like this can solve it?
https://gvectors.com/forum/postid/36946/

 

VereK
Posts: 522
(@verek)
Honorable Member
Joined: 7 years ago

Similar to what @tutrix gave you but maybe you can use the "not(.logged-in)" operator.

Like so in Dashboard > wpForo > Settings > Colors & Styles > Custom CS

/* Show Nothing but headers, footer & menus to guests*/
body:not(.logged-in) .wpforo-content {display: none;}
body:not(.logged-in) .wpforo-right-sidebar {display: none;}

 

2 Replies
 mhit
(@mhit)
Joined: 2 years ago

Estimable Member
Posts: 59

@verek Thanks so much! This looks so much better already.

Is there by any chance also a way to completely hide the forum footer for not logged in users / guests? I tried to hide a few items without success....

VereK
(@verek)
Joined: 7 years ago

Honorable Member
Posts: 522

@mhit 

Same way for the most part in Dashboard > wpForo > Settings > Colors & Styles > Custom CS

body:not(.logged-in) #wpforo-footer {display: none;}

The result would probably be aesthetically unpleasant but I you could add in a div element to fix that.

VereK
Posts: 522
(@verek)
Honorable Member
Joined: 7 years ago

Or keep the footer and hide only certain elements within in it.

Edit. This is currently what your footer looks like to a guest. Which to me looks okay

 

5 Replies
 mhit
(@mhit)
Joined: 2 years ago

Estimable Member
Posts: 59

@verek Thanks a lot for your super quick response!

I have completely hidden all forum info except for the forum menu by the following code:

/* Show Nothing but forum menu to guests*/
body:not(.logged-in) .wpforo-right-sidebar {display: none;}
body:not(.logged-in) .wpf-topic-icons {display: none;}
body:not(.logged-in) .wpf-forum-icons {display: none;}
body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-stat-body .wpf-newest-member {display: none;}
body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-stat-header .wpf-footer-title {display: none;}
body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-stat-header .wpf-footer-buttons {display: none;}

 

I had to take out this line: body:not(.logged-in) .wpforo-content {display: none;}

so it still shows Forum Title and  the menu 'unread messages / Forums / Tags/Subjects'

because otherwise the register / login page won't show any content.

But it looks much better now to me!

 

VereK
(@verek)
Joined: 7 years ago

Honorable Member
Posts: 522

@mhit 

Glad you like the result Just make sure your registration links are all working; at the moment it appears they don't.

 mhit
(@mhit)
Joined: 2 years ago

Estimable Member
Posts: 59

@verek Yes, I just fount out! 😋  I had to change the above code and will try to find a way to hide only that particular Forum Title text with unread messages menu

VereK
(@verek)
Joined: 7 years ago

Honorable Member
Posts: 522

@mhit 

body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-title {display: none;}

That should hide all three elements. Your registration links are now working. Well done.

 mhit
(@mhit)
Joined: 2 years ago

Estimable Member
Posts: 59

@verek You are a genius, thanks a lot! Looks excellent to me now! 👍

(I am not completely sure if it causes delay in loading the pages, but I will try to test that)

Posts: 59
 mhit
Topic starter
(@mhit)
Estimable Member
Joined: 2 years ago

Here the complete code if anyone needs it:

/* Show Nothing but forum menu to guests*/
body:not(.logged-in) .wpf-p-error {display: none;}
body:not(.logged-in) .wpf-head-bar {display: none;}
body:not(.logged-in) .wpforo-feed {display: none;}
body:not(.logged-in) .wpforo-right-sidebar {display: none;}
body:not(.logged-in) .wpf-topic-icons {display: none;}
body:not(.logged-in) .wpf-forum-icons {display: none;}
body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-title {display: none;}
body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-stat-body .wpf-newest-member {display: none;}
body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-stat-header .wpf-footer-title {display: none;}
body:not(.logged-in) #wpforo #wpforo-wrap #wpforo-stat-header .wpf-footer-buttons {display: none;}