首页 > 解决方案 > 在 Wordpress 中删除 get_permalink

问题描述

我正在我的网站上工作,我想删除小部件中的页面链接,以便显示标题和内容,但无法访问页面。有人可以帮忙吗?谢谢你。

<?php
   echo '<a href="'.esc_url(get_permalink()).'" class="all-link">';
   the_title();
   echo '</a>';
    ?>

标签: wordpress

解决方案


好吧,只需擦除a标签及其所有属性,而且您不需要echofor the_title(); orthe_content()` ,因为这些 WP 函数已经回显了这些:

<?php
   the_title();
?>

推荐阅读