【问题标题】:Footer menu only shows up on home page页脚菜单仅显示在主页上
【发布时间】:2014-12-08 11:28:36
【问题描述】:

我在functions/footer.php 中向我网站的页脚添加了一个菜单,它会根据需要显示在我的主页上,但它不会显示在任何帖子页面上。

这里是网站http://www.cultcitychi.com/

下面是我的footer.php代码

`?>

</div><!-- #content -->

<footer id="colophon" class="site-footer" role="contentinfo">
    <div class="site-info">

<?php // footer menu
wp_nav_menu( array('container_class' => 'menu-footer',
'theme_location' => 'secondary' ) ); ?>

    </div><!-- .site-info -->
</footer><!-- #colophon -->

`

【问题讨论】:

  • 您是否在模板 single.php 中包含了页脚?
  • single.php 已经以该代码结束

标签: php html css footer


【解决方案1】:

您需要在single.php 文件的底部添加此代码,以便在每个帖子页面上显示页脚:

<?php get_footer(); ?>

更新:

我使用开发人员工具检查了您的网站,并且页脚出现在帖子页面上,但由于您的 CSS 存在缺陷,它没有出现。请在样式表的底部添加以下 CSS,这应该可以解决问题:

.single.single-thumbnail .site {
     height: auto;
}

.single.single-thumbnail .site-footer {
     padding-top: 0px;
}

.site-info {
    margin: 0px auto;
    padding-bottom: 0px;
}

footer#colophon {
    z-index: 999;
}

【讨论】:

  • 该代码已经存在。菜单显示在其他页面上,问题是它没有显示在帖子上。
  • 你能分享你网站的链接吗?
  • @pascale 请检查我对上面答案所做的编辑,这应该可以解决您面临的问题。
  • 查看第二篇文章,例如:您的添加(确实有效)添加了一个新的页脚容器,该容器将页面向上移动,并在第二篇文章的示例中离开页面顶部。
  • 将此 CSS 与上面我编辑的答案中的 CSS 一起添加到您的样式表中:.single.single-thumbnail .entry-background { height: 667px; top: 0px; margin-top: -64px; }。这应该可以完美运行。
猜你喜欢
  • 1970-01-01
  • 2014-05-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-06
  • 2011-12-28
相关资源
最近更新 更多