【问题标题】:Wordpress: footer is cut off in page onlyWordpress:页脚仅在页面中被切断
【发布时间】:2014-07-12 14:35:12
【问题描述】:

我正在寻求帮助,因为 Wordpress 主题的页脚有一个非常奇怪的行为:整体看起来不错 (http://gwyneth-paltrow.org/test/) 但是,如果我点击一个页面, 它似乎被切断了 (http://gwyneth-paltrow.org/test/?page_id=2)。

看起来页脚从页面宽度中“获取”了它的宽度,并且它也是偏心的。老实说,我不知道问题出在 CSS 上(但如果是这样,我应该在整个网站上遇到同样的问题,而不是仅在页面上发生)还是在 page.php 文件的编码中。我远非专家,但如果我必须打赌,我会说后者,因为那是问题出现的时候。

我正在添加page.php的编码:

<?php get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div  id="post-<?php the_ID(); ?>">
<table>
<tbody>
<tr>
<td style="height:95px; background: url(images/title-nodate.png);valign:top;">
<table style="width:616px;">
<tr>
<td style="width:616px;"><div class="title-nodate"><?php the_title(); ?></div></td>
</tr></table>
<tr>
<td style="width:616px; background: url(images/content.png);">
<div class="content">
<?php the_content('Continue reading &raquo;'); ?></div>
</td>
</tr>
<tr>
<td style="width:616px; height:52px; background: url(images/content-bottom.png);"></td>
</tr>
</tbody>
</table></div>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
<?php get_footer(); ?>

非常感谢您的任何建议!

【问题讨论】:

    标签: php wordpress footer


    【解决方案1】:

    您有一个未关闭的&lt;div&gt; 导致第 2 页上的显示问题。请参阅[Invalid] Markup Validation of gwyneth-paltrow.org test ?page_id=2 - W3C Markup Validator。在验证报告中向下滚动以查看行号和源代码并与测试页面进行比较。您需要在页面模板中编辑/添加该结束标记。

    【讨论】:

    • 感谢您的回复!我以为我在 index.php 文件中关闭了那个
      ,因为我在 ?>。无论如何,我从 index.php 中删除了
      并将其移到 page.php 上 但不幸的是,问题似乎仍然存在。
    • 没关系,它成功了!由于某种原因,我正在编写表单的 PC 没有正确刷新页面,但它确实有效。基本上,为了正确看到页脚,我在 旁边添加了 2 个关闭 div
      。非常感谢!
    猜你喜欢
    • 2012-04-22
    • 2022-01-02
    • 2014-05-25
    • 2018-09-21
    • 1970-01-01
    • 1970-01-01
    • 2018-04-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多