Notifications
Clear all

[Closed] Remove the sidebar on certain pages

9 Posts
3 Users
4 Reactions
527 Views
Posts: 27
Topic starter
(@scoufy)
Eminent Member
Joined: 1 year 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: 1304
(@tutrix)
Noble Member
Joined: 4 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)
Joined: 1 year ago

Eminent Member
Posts: 27

@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: 4 years ago

Noble Member
Posts: 1304

@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)
Joined: 1 year ago

Eminent Member
Posts: 27

@tutrix 

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

dimalifragis
Posts: 2610
(@dimalifragis)
Famed Member
Joined: 4 years ago

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

3 Replies
(@scoufy)
Joined: 1 year ago

Eminent Member
Posts: 27

@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: 4 years ago

Famed Member
Posts: 2610

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

(@scoufy)
Joined: 1 year ago

Eminent Member
Posts: 27

@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 🙂