how to remove sidebar on single post and pages using css
-
<?php
/**
* Single post template
*
* @package Rowling
*/get_header(); ?>
” .esc_html__( ‘Next’, ‘rowling’ ) . ‘ ‘ .
” . esc_html__( ‘Next post:’, ‘rowling’ ) . ‘ ‘ .
‘%title’,
‘prev_text’ => ” . esc_html__( ‘Previous’, ‘rowling’ ) . ‘ ‘ .
” . esc_html__( ‘Previous post:’, ‘rowling’ ) . ‘ ‘ .
‘%title’,
) ); ?></div> <!– /wrapper –>
<?php get_footer(); ?>
The blog I need help with is: (visible only to logged in users)
-
You don’t need CSS to hide widgets on specific pages – I’d suggest you use the Visibility setting on each widget instead:
The conditions you’ll want to set on each widget are:
Hide if page is Posts page, AND
Hide if page is Post type – postLet me know how it goes.
-
Hi there,
These forums are for free sites hosted with WordPress.com. Your site is not hosted on WordPress.com, but using the open source WordPress software found on WordPress.org. We are not able to provide support for custom code or child themes in this forum. Please try the self-hosted WordPress forums instead:
https://wordpress.org/support/
That said, a much simpler option would be to simply hide the sidebar using custom CSS, rather than editing the PHP files.
@abhishekshahji
Please check where a site is hosted before answering a question. Also, the widget visibility settings only affect visibility of individual widgets, while the OP asked how to hide the entire sidebar. The code the OP provided is PHP, not CSS, though CSS is a good way to make this particular change.
- The topic ‘how to remove sidebar on single post and pages using css’ is closed to new replies.