2013-04-07 125 views
0

我想合併兩行代碼,並作爲代碼noob,不可避免地有麻煩。我想使用提供的lightwindow類將我的文章縮略圖鏈接鏈接到永久鏈接。我也必須保持回聲。讓我的WordPress的the_post_thumbnail鏈接永久

這裏是原代碼:

echo '<li>'; the_post_thumbnail('blog-post-thumb'); echo '</li>'; 

這裏想什麼,我整合。

<h3><a href="<?php the_permalink();?>" class="lightwindow"><?php the_title(); ?></a></h3> 

回答

1

爲什麼不使用php連擊是這樣的:

echo "<a class='lightwindow' href='".the_permalink()."'><li>".the_post_thumbnail('blog-post-thumb')."</li></a>";

這樣,你只需要使用echo一次,而不是一堆倍。

這是不必要的。