我想要使用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