我想要使用2个变量获得链接,但输出是链接和标题,但没有出现html/clickable链接。PHP语法问题
我得到的东西此链接:
http://www.mydomain.com/post1/post_title_here
下面是代码:
echo '<a href="'.the_permalink().'">'.the_title().'</a>';
谁能帮助吗?
感谢
UPDATE:
这里是整个代码块:
<div id="MyBlock1">
<?php
$query = new WP_Query('posts_per_page=5');
while($query ->have_posts()) : $query ->the_post();
echo '<li>';
echo '<a href="'.the_permalink().'">'.the_title().'</a>';
echo '</li>';
endwhile;
wp_reset_postdata();
?>
</div>
代码对我来说很好。什么是呈现? 'the_permalink()'的返回值是多少? – 2011-05-24 15:47:28
粘贴永久链接函数中的代码,以便我们知道它返回的内容 – amosrivera 2011-05-24 15:48:16
the_permalink()包含链接。例如:http://www.mydomain.com/post1/ – Satch3000 2011-05-24 15:49:16