如何删除这些 WordPress 函数产生的换行符?
我尝试了以下方法,但它不起作用:
<div class="entry">
<?php
echo the_date() . " " . the_category();
if ( $woo_options['woo_post_content'] == 'content' || is_single() ) { the_content(__('Continue Reading →', 'woothemes') ); } else { the_excerpt(); }
if ( $woo_options['woo_post_content'] == 'content' || is_singular() ) wp_link_pages( $page_link_args );
?>
现在输出看起来像这样:
July 7, 2011
Sports
我想删除两者之间的换行符,以便它看起来更像这样(全部在一行上):
July 7, 2011 Sports
I tried the following and it doesn't work:
<div class="entry">
<?php
echo the_date() . " " . the_category();
if ( $woo_options['woo_post_content'] == 'content' || is_single() ) { the_content(__('Continue Reading →', 'woothemes') ); } else { the_excerpt(); }
if ( $woo_options['woo_post_content'] == 'content' || is_singular() ) wp_link_pages( $page_link_args );
?>
Right now the output looks something like this:
July 7, 2011
Sports
I want to remove the line break between the two so that it looks more like this (all on one line):
July 7, 2011 Sports
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些函数不应内置换行符。您所看到的情况很可能是由于打开和关闭 PHP 造成的,或者是其他地方的杂散
造成的。向我们展示完整的代码,以便我们提供帮助。否则,请尝试以下操作:Those functions should not have line breaks built into them. Chances are what you are seeing is due to opening and closing your PHP, or a stray
<br/>
somewhere else. Show us the entire code so we can help. Otherwise, try this:嘿,不要将
echo
与the_date()
和the_category()
函数一起使用,因为它们本身会返回回显数据。Hey dont use
echo
withthe_date()
andthe_category()
functions, as they itself return echoed data.