【问题标题】:php link to another pagephp链接到另一个页面
【发布时间】:2012-12-30 18:05:38
【问题描述】:

我正在为我自己的个人网站编辑 wordpress 主题。该页面用于博客,当您单击“阅读更多”或博客标题时,它将在单独的页面中打开该博客以进行阅读。然而,当我点击这两件事时,我收到以下消息:

服务器错误网站在检索时遇到错误 我的网站/wordpress/?p=20。它可能因维护而停机或 配置不正确。以下是一些建议:重新加载此网站 稍后页面。 HTTP 错误 500(内部服务器错误):意外 服务器尝试完成时遇到条件 请求。

它以前工作过,所以我知道主题附带的代码工作正常。代码如下:

<div class="box">
<?php while ( have_posts() ) : the_post(); ?>
        <article>
            <h2><a href="<?php esc_url( the_permalink() ); ?>"<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
            <h7>BY LOUIS MOORE ON</h7> <time datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_date(); ?> <?php the_time(); ?></time><?php the_content(); ?>
<a href="<?php esc_url( the_permalink() ); ?>"/><h8>READ MORE</a></h8>  </br>   
</br><div class="h9"></div>
</article></br></br></br>
<?php endwhile; ?>

</div>

我在 php 方面不是最出色的,除了“阅读更多”、“路易斯·摩尔”第二个 div 和 &lt;/br&gt; 等内容之外,我并没有真正改变它的原始形式。

【问题讨论】:

  • 检查服务器上的 PHP 错误日志。这应该提供有关问题发生位置的信息。
  • @NRohler 我该怎么做?
  • 通常网络主机从管理仪表板提供该服务。您应该可以访问那里的 Web 服务器日志。
  • 顺便说一句,您应该从time 标记中删除pubdate 属性,它不再在specs 中。

标签: php html wordpress


【解决方案1】:

HTML 代码中有几个错误。也许这就是问题所在。

你可以试试这个:

<div class="box">
  <?php while ( have_posts() ) : the_post(); ?>
  <article>
    <h2><a href="<?php esc_url( the_permalink() ); ?>"> <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?> </a></h2>
    <h7>BY LOUIS MOORE ON</h7>
    <time datetime="<?php the_time( 'Y-m-d' ); ?>"> pubdate><?php the_date(); ?> <?php the_time(); ?></time><?php the_content(); ?>
    <a href="<?php esc_url( the_permalink() ); ?>"> </a>
    <h8>READ MORE</a></h8>
    <br /><br />
    <div class="h9"></div>
  </article><br /><br /><br />
  <?php endwhile; ?>
</div>

【讨论】:

    猜你喜欢
    • 2010-11-18
    • 1970-01-01
    • 1970-01-01
    • 2013-12-13
    • 1970-01-01
    • 2017-08-12
    • 1970-01-01
    • 2015-06-02
    • 1970-01-01
    相关资源
    最近更新 更多