单击帖子链接导致PHP WordPress中的空白页
我一直在尝试学习PHP,并且我被困在某一时刻。我创建了一些帖子并将其作为链接,但是在单击它们时,它们将我带到了空白页。
这是index.php code
<?php
while(have_posts()){
the_post();?>
<h2><a href="get_the_permalink()"><?php the_title(); ?></a></h2>
<?php the_content(); ?>
<?php
}
?>
这是single.php代码
<?php
while(have_posts()){
the_post();?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<?php
}
?>
我将href
值更改为另一个工作链接,它的工作很漂亮好吧,可能是永久链接的问题。我去了WordPress dashboard- permalink
,尝试了各种常见设置,但是问题仍然存在,有人可以帮助我吗?
I have been trying to learn PHP, and I am stuck at one point. I created some posts and made them as links, but on clicking them, they lead me to a blank page.
Here is the index.php code
<?php
while(have_posts()){
the_post();?>
<h2><a href="get_the_permalink()"><?php the_title(); ?></a></h2>
<?php the_content(); ?>
<?php
}
?>
Here is the single.php code
<?php
while(have_posts()){
the_post();?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<?php
}
?>
I changed the href
value to another working link, and it was working pretty well, the problem maybe with permalink. I went to WordPress dashboard->permalink
and tried all kinds of common settings, but the problem still exists, could someone help me out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用php函数始终包裹在
&lt;?php
-?&gt;
中You have to use PHP functions always wrapped inside
<?php
-?>