我试图调整Wordpress主题的页脚但无济于事。以下是footer.php文件中页脚的代码:
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after
*
* @package vslmd
*/
?>
<?php
//Variables > Theme Options
$options = get_option('vslmd_options');
$footerColumns = $options['footer_widget_columns'];
$footer_color_scheme = $options['footer_color_scheme'];
$footer_text = $options['footer_text'];
$footer_breadcrumbs = $options['footer_breadcrumbs'];
?>
<div class="footer-background-image">
<div class="wrapper wrapper-footer footer-background-color <?php echo $footer_color_scheme; ?>">
<div class="container">
<div class="row">
<div class="col-md-12">
<footer id="colophon" class="site-footer" role="contentinfo">
<?php if ( !is_front_page() && $footer_breadcrumbs == '1' ) { ?>
<div class="top-footer col-md-12">
<div class="breadcrumbs-footer col-md-9">
<?php if (function_exists('vslmd_breadcrumbs')) vslmd_breadcrumbs(); ?>
</div>
<div class="bottom-to-top col-md-3 text-right">
<span><i class="fa fa-angle-up"></i></span>
</div>
</div>
<?php } elseif ( is_front_page() || ( $footer_breadcrumbs != '' || $footer_breadcrumbs != '0' ) ) { ?>
<div class="top-footer col-md-12">
<div class="bottom-to-top text-center">
<span><i class="fa fa-angle-up"></i></span>
</div>
</div>
<?php } ?>
<div class="widgets-footer">
<?php
get_template_part('widget-templates/before-footer');
if($footerColumns == '1'){ ?>
<div class="col-md-12">
<?php if ( is_active_sidebar( 'first-footer' ) ) { ?>
<?php dynamic_sidebar('first-footer'); ?>
<?php } ?>
</div>
<?php } else if($footerColumns == '2'){ ?>
<div class="col-md-6">
<?php if ( is_active_sidebar( 'first-footer' ) ) { ?>
<?php dynamic_sidebar('first-footer'); ?>
<?php } ?>
</div>
<div class="col-md-6">
<?php if ( is_active_sidebar( 'second-footer' ) ) { ?>
<?php dynamic_sidebar('second-footer'); ?>
<?php } ?>
</div>
<?php } else if($footerColumns == '3'){ ?>
<div class="col-md-4">
<?php if ( is_active_sidebar( 'first-footer' ) ) { ?>
<?php dynamic_sidebar('first-footer'); ?>
<?php } ?>
</div>
<div class="col-md-4">
<?php if ( is_active_sidebar( 'second-footer' ) ) { ?>
<?php dynamic_sidebar('second-footer'); ?>
<?php } ?>
</div>
<div class="col-md-4">
<?php if ( is_active_sidebar( 'third-footer' ) ) { ?>
<?php dynamic_sidebar('third-footer'); ?>
<?php } ?>
</div>
<?php } else if($footerColumns == '4'){ ?>
<div class="col-md-3">
<?php if ( is_active_sidebar( 'first-footer' ) ) { ?>
<?php dynamic_sidebar('first-footer'); ?>
<?php } ?>
</div>
<div class="col-md-3">
<?php if ( is_active_sidebar( 'second-footer' ) ) { ?>
<?php dynamic_sidebar('second-footer'); ?>
<?php } ?>
</div>
<div class="col-md-3">
<?php if ( is_active_sidebar( 'third-footer' ) ) { ?>
<?php dynamic_sidebar('third-footer'); ?>
<?php } ?>
</div>
<div class="col-md-3">
<?php if ( is_active_sidebar( 'fourth-footer' ) ) { ?>
<?php dynamic_sidebar('fourth-footer'); ?>
<?php } ?>
</div>
<?php } else if($footerColumns == '5'){ ?>
<div class="col-md-8">
<?php if ( is_active_sidebar( 'first-footer' ) ) { ?>
<?php dynamic_sidebar('first-footer'); ?>
<?php } ?>
</div>
<div class="col-md-4">
<?php if ( is_active_sidebar( 'second-footer' ) ) { ?>
<?php dynamic_sidebar('second-footer'); ?>
<?php } ?>
</div>
<?php } else if($footerColumns == '6'){ ?>
<div class="col-md-4">
<?php if ( is_active_sidebar( 'first-footer' ) ) { ?>
<?php dynamic_sidebar('first-footer'); ?>
<?php } ?>
</div>
<div class="col-md-8">
<?php if ( is_active_sidebar( 'second-footer' ) ) { ?>
<?php dynamic_sidebar('second-footer'); ?>
<?php } ?>
</div>
<?php } else if($footerColumns == '7'){ ?>
<div class="col-md-3">
<?php if ( is_active_sidebar( 'first-footer' ) ) { ?>
<?php dynamic_sidebar('first-footer'); ?>
<?php } ?>
</div>
<div class="col-md-6">
<?php if ( is_active_sidebar( 'second-footer' ) ) { ?>
<?php dynamic_sidebar('second-footer'); ?>
<?php } ?>
</div>
<div class="col-md-3">
<?php if ( is_active_sidebar( 'third-footer' ) ) { ?>
<?php dynamic_sidebar('third-footer'); ?>
<?php } ?>
</div>
<?php } ?>
<?php get_template_part('widget-templates/after-footer'); ?>
</div>
<div class="site-info bottom-footer col-md-12">
<div class="row vertical-centering">
<div class="col-md-6 copyright-footer-item">
<?php if(empty($footer_text)) { ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'vslmd' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'vslmd' ), 'WordPress' ); ?></a>
<span class="sep"> | </span>
<?php printf( __( 'Theme: %1$s by %2$s.', 'vslmd' ), 'Mastergen', '<a href="https://visualmodo.com/" rel="designer">visualmodo.com</a>' ); ?>
<?php } else { ?>
<span><?php echo $footer_text ?></span>
<?php } ?>
</div>
<?php get_template_part('widget-templates/copyright-footer'); ?>
</div>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!--col end -->
</div><!-- row end -->
</div><!-- container end -->
</div><!-- background color end -->
</div><!-- wrapper end -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>
此外,这里是CSS文件中页脚部分的代码:
.wrapper-footer {
background-color: #222328;
padding: 2.5em; }
.wrapper-footer .widget-footer-title {
text-transform: uppercase;
font-size: 1.4rem;
letter-spacing: 0.075rem;
margin-bottom: 2rem;
font-weight: bold;
color: rgba(255, 255, 255, 0.6); }
.wrapper-footer .widgets-footer ol,
.wrapper-footer .widgets-footer ul {
margin: 0 0 1.75em;
padding: 0;
list-style: none; }
.wrapper-footer .widgets-footer ol li,
.wrapper-footer .widgets-footer ul li {
padding: 0.250em 0; }
.wrapper-footer .widgets-footer ol li a,
.wrapper-footer .widgets-footer ul li a {
color: #FFF; }
.wrapper-footer .widgets-footer ol li a:hover,
.wrapper-footer .widgets-footer ul li a:hover {
color: #685d9f; }
footer .site-info.bottom-footer {
border-top: 1px solid;
padding-top: 2.250em;
margin-top: 2.250em; }
我尝试更改任何值,但仍然没有差异。这是一个关于页脚实际外观的图像。
我想要的是减少不同小部件之间的空间,使整个页脚更加紧凑。我需要在HTML或CSS中进行哪些更改?
非常感谢你的帮助!
斯特凡诺