• Hi!

    Please have a look at https://ask4life.se/

    As you can see, I added footer widgets to the Twenty Twelve theme, but there’s a big gap between the widgets and the end of the posts/pages.

    Anyone know how I can get a smaller gap so the widgets comes closer to the text in the pages?

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • That big gap is coming from the following settings on about line 972 of your theme’s style.css:

    .site-content article {
      margin-bottom: 5.14286rem;
      padding-bottom: 1.71429rem;
    }

    To remove it, you can add custom CSS that reduces or removes that extra space. For example, you could add this:

    .site-content article {
      margin-bottom: none;
    }

    If you want to reduce it even more, you could reduce the amount of padding-bottom, too.

    If you’re going to make these kinds of modifications to a theme, you really should be working with a child theme so your changes aren’t overwritten when there is a theme update.

    Thread Starter Carl-Johan Holmberg

    (@ahauahau)

    Thanks a lot, linux4me2!

    It worked when I put the value “0” instead of “none;” in the code you wrote

    .site-content article {
      margin-bottom: 0
    }

    EDIT: I just installed the plug-in “Child Theme Configurator” and copied my current theme with all my changes into this. This will work as a back-up, right?

    Again, THANKS A LOT!

    Whoops! Sorry about that. Yes, zero is the default for margin-bottom, not “none”.

    Make sure to end all CSS declarations with a semi-colon like this:

    .site-content article {
      margin-bottom: 0;
    }

    I haven’t used the Child Theme Configurator, so I can’t answer that. I prefer to use as few plugins as possible–the less third-party code, the better–so building a child theme as described in the Codex article I linked to above is the way to go, I think. It’s not as complicated as it sounds.

    For Twenty Twelve, in addition to the style.css with your custom CSS, you’ll need a functions.php in your child theme folder with the following in it to enqueue the parent Twenty Twelve theme:

    <?php
      add_action('wp_enqueue_scripts', 'enqueue_parent_theme_style');
      function enqueue_parent_theme_style() {
        wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
      }
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Resize page height in Twenty Twelve’ is closed to new replies.