简体   繁体   English

固定链接不起作用

[英]Permalink is not working

I've got a page that is for a blog and what is meant to happen is that when you click on the 'read more' or blog title then it will open that blog in the separate page to read. 我有一个用于博客的页面,这意味着当您单击“阅读更多”或博客标题时,它将在单独的页面中打开该博客以供阅读。 However when I click these two things I get the following message: 但是,当我单击这两项时,会收到以下消息:

Server error The website encountered an error while retrieving mywebsite/wordpress/?p=20. 服务器错误网站在检索mywebsite / wordpress /?p = 20时遇到错误。 It may be down for maintenance or configured incorrectly. 可能由于维护原因而停机或配置不正确。 Here are some suggestions: Reload this web page later. 以下是一些建议:稍后重新加载此网页。 HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request. HTTP错误500(内部服务器错误):服务器尝试满足请求时遇到了意外情况。

here is the code: 这是代码:

<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>

Where am i going wrong? 我要去哪里错了?

you should try remove esc_url ... 您应该尝试删除esc_url ...
besides move </h8> inside the a tag 除了移动</h8>内部a标签

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

UPDATE 更新

Lets debug, put this in your wp-config: 让我们调试,将其放入您的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);

to get error info in the screen, this is a development stage, right? 在屏幕上获取错误信息,这是开发阶段,对吗?

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

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