0

我正在尝试合并两行代码,作为一个代码菜鸟,不可避免地会遇到麻烦。我想使用提供的 lightwindow 类将我的帖子缩略图链接到永久链接。我还必须保留回声。

这是原始代码:

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

这就是我想要整合的内容。

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

1 回答 1

1

为什么不使用php这样的连接:

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

这样你只需要使用echo一次而不是一堆时间。

这是不必要的。

于 2013-04-07T13:27:19.767 回答