• I’ve searched forums and pages for ages on this issue and hope someone can help. Eventually followed advice on: this page

    I duplicated the page.php, added it to my child theme and replaced this code:
    <?php get_sidebar();?>

    With this

    <?php if (!is_page('x')) : get_sidebar(); endif; ?>

    inserting the relevant page number for ‘x’ – and it worked ie side bar finally removed.

    Then I tried increasing the page to site wide as he recommends – but it didn’t work ie the page shifted right over to the left hand side without the white ‘page’ section increasing at all. I replaced <div class=”container”> with his code & added the exact css to style.css file.

    ie <blockquote><div class="myclass">

    Switch that for…
    <div class="<?php if (!is_page('x')) : ?>myclass<?php else : ?>myclasswider<?php endif; ?>">

    Basically when you on page X where X is the number or page name the sidebar is not shown and the class for the container DIV is switched to (in the new example) “myclasswider”, and uses the class “myclass” when showing the sidebar..

    It’s a little confusing when using an example name….

    So when the sidebar is shown…

    <div class"myclass">
    
    When the sidebar is not shown..
    <div class"myclasswider">

    You then accompany that with css to change width… (again another example)..

    .myclass {
    width:800px
    }
    .myclasswider {
    width:1000px
    }</blockquote>

    I now have TWO “Bumpers in Stock headings”.

    See: https://aaiauto.co.za/bumpers-in-stock/
    Please can you advise? Or can you please point me in the right direction? Really would appreciate any/all help! Just stuck.

    Many thanks in advance! ??

Viewing 1 replies (of 1 total)
  • Thread Starter AliWil

    (@aliwil)

    Hokay, managed to disappear the double page header problem – just deleted page.php under child theme, re-created it from a copy of the main theme, and then replaced
    <?php get_sidebar();?> line with
    <?php if (!is_page('x')) : get_sidebar(); endif; ?>

    Worked perfectly.

    Still battling to get it to page to extend site wide.

    Also tried adding this CSS:

    div#235 {width:100%;}

    Didn’t solve the problem.

    Any ideas please?? Really stumped with this ??

Viewing 1 replies (of 1 total)
  • The topic ‘Trying to hide sidebar from one page and making it sidewide’ is closed to new replies.