我有一个使用HTML和PHP相结合的问题。在HTML中使用固定链接
我这个小码:
$args = array('post_type' => 'program', 'posts_per_page' => 100);
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post();
echo '<div class="singleprogram">';
echo '<div class="entry-title"><a href="'the_permalink()'">';
the_title();
echo '</a></div>';
echo '<div class="entry-content">';
the_content();
echo '</div></div>';
endwhile;
如果我用这个,我的网页得到所有空白。任何ID我做错了什么?
(如果我删除the_permalink()
,并留下一个空白href=""
然后它的工作,但当然,它不会链接到的东西)
提前感谢!
感谢您的快速回复! 当我在脚本中使用点,我得到以下结果: [链接] http://www.octest.nl/testerror/error1.png 所以永久链接是可见的,但需要放置在一个href – user2190380
使用浏览器的工具检查元素(如果是Firefox,请右键单击并选择“检查元素”)。或者查看页面的源代码。也许“the_permalink()”函数会创建一个完整的a-tag,在这种情况下,您可能会有2个a-tags。 - 只是一个猜测。 –