Notifications
Clear all

[Closed] Remove the sidebar on certain pages

9 Posts
3 Users
4 Reactions
850 Views
Scoufy
Posts: 41
Topic starter
(@scoufy)
Trusted Member
Joined: 2 years ago

Hi,

Following a "censorship" from Adsence which alerts me that I am breaking certain rules... I would like to find a possibility of deactivating the sitebar on the login (/sign-in/), registration, password reset pages and all pages of this kind. Adsence alerts me to the login page because I have an ads code in the sidebar.

It is true that the sidebar on this type of page is not very useful because you only go there to connect, register or edit your profile and the essentials are there...

Is there a possibility to remove the sidebar on this type of page or could it be added during an update?

Topic Tags
8 Replies
Tutrix
Posts: 1493
(@tutrix)
Noble Member
Joined: 5 years ago

Hi@scoufy

You can remove the sidebar with CSS 😉 

Example login and register

#wpforo #wpforo-wrap.wpft-register .wpforo-right-sidebar {width: 0%; display: none;}
#wpforo #wpforo-wrap.wpft-register .wpforo-content {width:100%;}
#wpforo #wpforo-wrap.wpft-login .wpforo-right-sidebar {width: 0%; display: none;}
#wpforo #wpforo-wrap.wpft-login .wpforo-content {width:100%;}
3 Replies
Scoufy
(@scoufy)
Joined: 2 years ago

Trusted Member
Posts: 41

@tutrix 

Thanks for the code, it works!

I had thought about it but I didn't know where to find the right css lines to do it on a specific page...

Could you give a tip to find this part of code:

#wpforo-wrap.wpft-login

I'm looking to do this for for example the page /change-password/ (/lostpassword) and perhaps on other pages such as to edit the profile, etc...

I think this should be removed directly for this page style or give the user the power to do it from the settings.

Tutrix
(@tutrix)
Joined: 5 years ago

Noble Member
Posts: 1493

@scoufy 

You can find it by using the Browser Inspector

#wpforo #wpforo-wrap.wpft-lostpassword .wpforo-right-sidebar {width: 0%; display: none;}
#wpforo #wpforo-wrap.wpft-lostpassword .wpforo-content {width:100%;}
Scoufy
(@scoufy)
Joined: 2 years ago

Trusted Member
Posts: 41

@tutrix 

Great, now I know about the other pages.
Thank you for sharing 😉 

dimalifragis
Posts: 2611
(@dimalifragis)
Famed Member
Joined: 5 years ago

Why not use a Widgets Options plugin to controll all that?

3 Replies
Scoufy
(@scoufy)
Joined: 2 years ago

Trusted Member
Posts: 41

@dimalifragis 

The reason is simple, limit the number of plugins as much as possible. This is why I think that this "option" could be native because it only requires a few lines of code, which is not the case for a plugin.

dimalifragis
(@dimalifragis)
Joined: 5 years ago

Famed Member
Posts: 2611

@scoufy Not a good reason, i'm sorry. A widget options plugin is a must.

Scoufy
(@scoufy)
Joined: 2 years ago

Trusted Member
Posts: 41

@dimalifragis 

I didn't say it wasn't essential.
For this example I think I don't need it for a few lines of CSS, which will be less heavy than a plugin... I use one for example to put a fixed widget in the sidebar 🙂