css - 如何删除我的 wordpress 2016 上的空白

标签 css wordpress

我在减少和/或删除 wordpress 网页底部的空白区域时遇到问题。使用检查器,黑色空间似乎超过了 2 个 css div。

我需要在自定义 css 区域添加代码来解决这个问题,但我不知道要添加什么。

 http://andrewt.com.au/wp1/

  this is the footer.php code 
<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since Twenty Sixteen 1.0
 */
?>

        </div><!-- .site-content -->

        <footer id="colophon" class="site-footer" role="contentinfo">
            <?php if ( has_nav_menu( 'primary' ) ) : ?>
                <nav class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Primary Menu', 'twentysixteen' ); ?>">
                    <?php
                        wp_nav_menu( array(
                            'theme_location' => 'primary',
                            'menu_class'     => 'primary-menu',
                         ) );
                    ?>
                </nav><!-- .main-navigation -->
            <?php endif; ?>

            <?php if ( has_nav_menu( 'social' ) ) : ?>
                <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>">
                    <?php
                        wp_nav_menu( array(
                            'theme_location' => 'social',
                            'menu_class'     => 'social-links-menu',
                            'depth'          => 1,
                            'link_before'    => '<span class="screen-reader-text">',
                            'link_after'     => '</span>',
                        ) );
                    ?>
                </nav><!-- .social-navigation -->
            <?php endif; ?>

        </footer><!-- .site-footer -->
    </div><!-- .site-inner -->
</div><!-- .site -->

<?php wp_footer(); ?>
</body>
</html>

最佳答案

将此代码添加到您的 footer.php

<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since Twenty Sixteen 1.0
 */
?>
<style>
    @media screen and (min-width: 61.5625em){
        .content-area .site-main {
            margin-bottom: 0px;
        }
    }
</style>
    </div><!-- .site-content -->

    <footer id="colophon" class="site-footer" role="contentinfo">
        <?php if ( has_nav_menu( 'primary' ) ) : ?>
            <nav class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Primary Menu', 'twentysixteen' ); ?>">
                <?php
                    wp_nav_menu( array(
                        'theme_location' => 'primary',
                        'menu_class'     => 'primary-menu',
                     ) );
                ?>
            </nav><!-- .main-navigation -->
        <?php endif; ?>

        <?php if ( has_nav_menu( 'social' ) ) : ?>
            <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>">
                <?php
                    wp_nav_menu( array(
                        'theme_location' => 'social',
                        'menu_class'     => 'social-links-menu',
                        'depth'          => 1,
                        'link_before'    => '<span class="screen-reader-text">',
                        'link_after'     => '</span>',
                    ) );
                ?>
            </nav><!-- .social-navigation -->
        <?php endif; ?>

    </footer><!-- .site-footer -->
</div><!-- .site-inner -->

关于css - 如何删除我的 wordpress 2016 上的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48088163/

相关文章:

hover - CSS "absolutely"定位边框图像

javascript - OnScrolling 新页面自动加载

centOS中的WordPress权限问题

php - Wordpress:从数据库中检索值

javascript - 使用搜索栏在列中过滤具有重复条目的区分大小写的数据并返回该特定行 AngularJS

javascript - 此动画在 IE 11 中最后闪烁

css - div在ie中不可见,在ff和chrome中不可见

php - jQuery 验证 submitHandler 不适用于 WP AJAX/wp_localize_script

javascript - Dropbox uploader 无法调用未定义的方法 'submit'

html - 粘性 header 始终可见?