wordpress 页脚 css 不起作用
wordpress Footer css doesn't work
页脚 css 出现在除 single.php
页面之外的每个页面上。浏览器在 css 中的每个页面上读取:
#sidebar + #wrapper + #footer {
margin-left:18em;
}
但完整 post 页
#sidebar + #wrapper + #footer {
margin-left: 18em;
}
没用
页脚 css
/* Footer */
#sidebar + #wrapper + #footer {
margin-left: 18em;
}
@media screen and (max-width: 1280px) {
#sidebar + #wrapper + #footer {
margin-left: 0;
}
}
#footer > .inner a {
border-bottom-color: rgba(255, 255, 255, 0.15);
}
#footer > .inner a:hover {
border-bottom-color: transparent;
}
#footer > .inner .menu {
font-size: 0.8em;
color: rgba(255, 255, 255, 0.15);
}
#header + #wrapper + #footer > .inner {
margin: 0 auto;
}
footer.php
<!-- Footer -->
<footer id="footer" class="wrapper style1-alt">
<div class="inner">
<ul class="menu">
<?php if ( ! dynamic_sidebar( 'footer_sidebar' ) ) : ?>
<li>© Untitled. All rights reserved.</li>
<?php endif; ?>
</ul>
</div>
</footer>
<!-- Scripts -->
<?php wp_footer(); ?>
</body>
</html>
single.php
<?php get_header(); ?>
<!-- Wrapper -->
<div id="wrapper">
<!-- One -->
<section id="one" class="wrapper style2 spotlights">
<?php while(have_posts()) : the_post(); ?>
<section>
<div class="content">
<div class="sin_content">
<h2><?php the_title(); ?></h2>
<?php echo do_shortcode("[easy_image_gallery]");
remove_filter( 'the_content', 'easy_image_gallery_append_to_content' ); ?>
</div>
<?php the_content(); ?>
</div>
</div>
</section>
<div class="wordpress_commentss-hd">
<div class="wordpress_commentss">
<?php comments_template(); ?>
</div>
</div>
<?php endwhile; ?>
</section>
</div>
<?php get_footer(); ?>
为什么它不能在完整的 post 页面上工作,而在其他页面上工作正常?
哈哈,找到了 :) 你的结尾 div 太多了。删除single.php之间的那个:
remove_filter( 'the_content', 'easy_image_gallery_append_to_content' ); ?>
</div> <--- That one!
<?php the_content(); ?>
页脚 css 出现在除 single.php
页面之外的每个页面上。浏览器在 css 中的每个页面上读取:
#sidebar + #wrapper + #footer {
margin-left:18em;
}
但完整 post 页
#sidebar + #wrapper + #footer {
margin-left: 18em;
}
没用
页脚 css
/* Footer */
#sidebar + #wrapper + #footer {
margin-left: 18em;
}
@media screen and (max-width: 1280px) {
#sidebar + #wrapper + #footer {
margin-left: 0;
}
}
#footer > .inner a {
border-bottom-color: rgba(255, 255, 255, 0.15);
}
#footer > .inner a:hover {
border-bottom-color: transparent;
}
#footer > .inner .menu {
font-size: 0.8em;
color: rgba(255, 255, 255, 0.15);
}
#header + #wrapper + #footer > .inner {
margin: 0 auto;
}
footer.php
<!-- Footer -->
<footer id="footer" class="wrapper style1-alt">
<div class="inner">
<ul class="menu">
<?php if ( ! dynamic_sidebar( 'footer_sidebar' ) ) : ?>
<li>© Untitled. All rights reserved.</li>
<?php endif; ?>
</ul>
</div>
</footer>
<!-- Scripts -->
<?php wp_footer(); ?>
</body>
</html>
single.php
<?php get_header(); ?>
<!-- Wrapper -->
<div id="wrapper">
<!-- One -->
<section id="one" class="wrapper style2 spotlights">
<?php while(have_posts()) : the_post(); ?>
<section>
<div class="content">
<div class="sin_content">
<h2><?php the_title(); ?></h2>
<?php echo do_shortcode("[easy_image_gallery]");
remove_filter( 'the_content', 'easy_image_gallery_append_to_content' ); ?>
</div>
<?php the_content(); ?>
</div>
</div>
</section>
<div class="wordpress_commentss-hd">
<div class="wordpress_commentss">
<?php comments_template(); ?>
</div>
</div>
<?php endwhile; ?>
</section>
</div>
<?php get_footer(); ?>
为什么它不能在完整的 post 页面上工作,而在其他页面上工作正常?
哈哈,找到了 :) 你的结尾 div 太多了。删除single.php之间的那个:
remove_filter( 'the_content', 'easy_image_gallery_append_to_content' ); ?>
</div> <--- That one!
<?php the_content(); ?>