2011-08-20 86 views
-1

我在WordPress数据表外面传来......WordPress的功能标签表

下面的代码

...

echo '<tr><td>Category</td><td>:</td><td>'. the_category(', ') .'</td></tr>'; 

类别名称不正确的位置显示,它是上面显示所有的行...

我想不通的问题......似乎一切都完美...

回答

0

使用get_the_category_list(', ')See documentation

get_the_category_list()返回结果,the_category()打印出结果

+0

明白了......谢谢 – Asho

+0

阿苏标记答案是正确的,如果你发现它解决了你的问题http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work –

0

那么这是值得echo将与打印结果,你应该使用它像HTML这样

<?php // some code ?> 
<tr><td>Category</td><td>:</td><td><?php the_category(', ') ?></td></tr> 
<?php // some code ?> 

使用功能的功能做。

+0

谢谢它... – Asho