0

enter image description here

I'm using the GovPress theme, I've created a child theme. I now want to remove the sidebar widgets, as they are no use to me.

I've read multiple articles online, but none of them work. I believe I need to create a functions.php in my child theme, but what needs to go into this file?

3
  • 2
    Post your attempted solutions, please, even if they don't work. I assume you want to remove the widgets from the backend "Widget" control panel so that they are not taking up space?
    – s_ha_dum
    Commented May 20, 2014 at 13:44
  • Where can I find the govpress theme?
    – Tom J Nowell
    Commented May 20, 2014 at 14:30
  • wordpress.org/themes/govpress Commented May 20, 2014 at 14:34

1 Answer 1

1

I believe you are talking about the three default widgets that are included in the sidebar.php template. I would just simply copy the sidebar.php to the child theme, and then delete these widgets manually.

After deletion of these widgets, you will be left with only the following code in sidebar.php

<?php
/**
 * The Sidebar containing the main widget areas.
 *
 * @package GovPress
 */
?>
    <div id="secondary" class="widget-area" role="complementary">
        <?php do_action( 'before_sidebar' ); ?>
        <?php if ( ! dynamic_sidebar( 'primary' ) ) : ?>

        <?php endif; // end sidebar widget area ?>
    </div><!-- #secondary -->

EDIT 1

For the sake of your content, you can do the following in your childtheme

    .content-area {
  float: left;
  margin: 0 0 0 0;
  width: 100%;
}

.col-width {
  max-width: 1160px;
  padding: 0 20px;
  margin: 0 auto;
}

.site-main {
  margin: 0 0 0 0;
  min-height: 100%;
}

.full-width .site-main {
  margin: 0;
}

#secondary {
  float: right;
  overflow: hidden;
  width: 0;
}

.site-footer {
  clear: both;
  width: 100%;
}

enter image description here

EDIT 2

This is the only other code I could find to solve your problem. I have already modified it, so paste this in your style.css

.layout-sidebar-left .site-main {
  margin: 0 0 0 0;
}

.layout-sidebar-left #secondary {
  float: left;
}

.layout-sidebar-left .content-area {
  float: right;
  margin: 0 0 0 0;
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.