Support » Theme: Nisarg » Nisarg-How to remove sidebar on certain pages

  • I’ve tried using custom page templates but they don’t seem to do anything, which I think is because I need to change the file ‘index.php’ as well. However, this would affect all the pages on my website. Is there a way to remove the sidebar (and make the page content full width) but only for certain pages?
    I would greatly appreciate any help. Thanks
    The website is: http://www.freshyoutubers.com/

Viewing 9 replies - 16 through 24 (of 24 total)
  • Hi again,
    it worked! 🙂 I had to delete the cookies from the site before it showed up right.
    But also, using SiteOrigin Editor makes the first paragraph bold and different style from the rest of the text. I’m thinking it maybe a “first-child”-thing. Any suggestions?

    Not sure without being able to see it, try inspecting the element and seeing where the CSS style is coming from.

    Ok, thank you – how can I send you the link without publishing it here?

    I don’t think there is any other way, you may be able to edit your post after though.

    Thanks webbersky.

    I started over with following your links, then deleted the site cookie and cleared the browser cache, but still do not get 100% on the pages with the “No sidebar Page” template.

    I edited the bootstrap file just to see chick to see if I’m ending the code in the right place and it worked, but of course every page was 100%.

    I appreciate your help, but not sure what I’m doing wrong. I’m doing straight copy-and-paste of your code and making changes to the domain where necessary. Any thoughts?

    Hi @webbersky,
    Sorry, I forgot to tag your name in my previous post.

    I went through all of the steps but it still does not work on http://sherylsteines.com/wizard-hall-chronicles/

    I know that I changed the code in the correct place since I did it on bootstrap.css file and it worked, on all pages of course.

    Any suggestions?
    Thanks!

    I’ve gone over my scripting notes (it’s always handy to keep a list in case you encounter any bugs), and here is what worked for me:

    Created no-sidebar-page.php:
    Copied page.php as no-sidebar-page.php.

    Removed line <?php get_sidebar(‘sidebar-1’); ?>
    Replaced comment at top with /*
     * Template Name: No Sidebar Page
     */

    Then in the plug-in Custom CSS I added (for the individual page):
    @media (min-width: 992px) {
    .col-md-9 {
    width: 100%;
    }

    The new WordPress seems to have it’s own custom CSS thing so you should try that first, but if it’s not working for you than I hope the method above helps.

    All the best 🙂

    @jimpea

    @media (min-width: 992px)
    bootstrap.css?ver=4.7.2:1949
    .col-md-9 {
    width: 75%;
    }

    The width is still 75% on your page, it needs to be 100%

    Thanks @dreamingsentinel and @webbersky

    Unfortunately, it looks like style2.css is not loading because I don’t see it when I inspect the page; only bootstrap.css appears.

    In an earlier test, I changed the code in bootstrap.css to 100% from 75% at the same location in style2.css and all pages displayed as 100%–including the pages that were on the default template, so I know that I’m editing the correct code.

    My testing is now on this page: http://sherylsteines.com/test/

    Below are the steps that I followed and I’ve created and recreated it several times. In addition, I added your recommend code to the WP Custom CSS, that did not work, and in the Custom CSS plugin and that too did not work.

    Created no-sidebar-page.php:
    Copied page.php as no-sidebar-page.php.

    Removed line <?php get_sidebar(‘sidebar-1’); ?>
    Replaced comment at top with /*
    * Template Name: No Sidebar Page
    */

    Added this code
    <link rel=’stylesheet’ id=’nisarg-style-css’ href=’http://sherylsteines.com/wp-content/themes/nisarg/style2.css’ type=’text/css’ media=’all’ />

    after
    get_header(); ?>

    Then created the style2.css file and in line 150 edited the code
    line 149: .col-md-9 {
    line 150: width: 100%;

    Note, this is under the following code:
    line 136: @media (min-width: 992px) {
    line 137: .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Nisarg-How to remove sidebar on certain pages’ is closed to new replies.