繁体   English   中英

固定链接不起作用

[英]Permalink is not working

我有一个用于博客的页面,这意味着当您单击“阅读更多”或博客标题时,它将在单独的页面中打开该博客以供阅读。 但是,当我单击这两项时,会收到以下消息:

服务器错误网站在检索mywebsite / 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>

我要去哪里错了?

您应该尝试删除esc_url ...
除了移动</h8>内部a标签

<a href="<?php the_permalink(); ?>"><h8>READ MORE</h8></a>

更新

让我们调试,将其放入您的wp-config中:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true); // creates and update wp-content/debug.log
define('WP_DEBUG_DISPLAY', true);
@ini_set('display_errors', 1);

在屏幕上获取错误信息,这是开发阶段,对吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM