开发者

Wordpress function tag coming outside the table

I have a table o开发者_运维百科f data in wordpress...

in the following code...

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

category name is not displaying in correct position, it is displaying above all the row...

i can't figure out the problem... everything seems perfect...


Use get_the_category_list(', '). See documentation.

get_the_category_list() returns the result, the_category() prints the result


Well that is something that echo will do with functions that print result you should use it like this

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

Use functions in html.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜