Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Page & Widget WordPress

  • SOLVED

Hi!

For some reason the widget area is visible on my pages - http://www.charlotteraboff.com/santa-monica/

What shall I do to delete the widget on just pages?

Thanks
Charlotte

Answers (5)

2013-05-13

Yakir Sitbon answers:

In page.php you should remove the "get_sidebar();" function.
That's function get the sidebar... so.. good luck. :)

2013-05-13

Asad Iqbal answers:

If there have not any full width page template available then you need to make or edit your current page template. Can you please inbox me your current page temple thus I can edit the code and get back to you?


Asad Iqbal comments:

You can just comment the get_sidebar(); function to as like following:

//get_sidebar();

2013-05-13

Daniel Yoen answers:


Hello

Find <?php get_sidebar(); ?> in page.php on your theme folder, replace with this :

if(!is_page("santa-monica"))
{
get_sidebar();
}

2013-05-13

Leslie Bogaerts answers:

Use a page template without sidebar (usually called full width page). If your theme doesn't come with one, I wrote a blog post with video on how to do this a few months back. You can read it here: http://ladywp.com/how-to-create-a-page-template-that-doesnt-have-a-sidebar/

Hope this helps.

2013-05-13

Eric P. answers:

If you never want a sidebar on a page, change line 19 of your page.php to
<?php //get_sidebar(); ?>

Or just delete that line.

If you want the option of having a page with a sidbar in the future, create a child theme with a "full page" template.

First, make a directory wp-content/themes/cleanr-child

Then create a style.css line in the cleanr-child directory with these lines.
/*
Theme Name: Cleanr Child
Template: Cleanr
*/
@import url("../cleanr/style.css");


And copy the page.php file from the wp-content/themes/cleanr directory and name it wp-content/themes/cleanr-child/page-full.php. Then make the change in page-full.php and also add these lines to the top of page-full.php

<?php
/*
Template Name: Full width page (no sidebar)
*/
?>


Once you have the child theme set up this way, you can activate it on the Appearance->Themes panel.

The advantage to doing this in a child theme is that if the parent theme (cleanr) is updated, your modifications in the child theme will not be wiped out by the upgrade.