开发者

How do I remove line breaks that these WordPress functions produce?

开发者 https://www.devze.com 2023-03-17 22:08 出处:网络
I tried the following and it doesn\'t work: <div class=\"entry\"> <?php echo the_date() . \" \" . the_category();

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 &rarr;', 'woothemes') ); } else { the_excerpt(); }
if ( $woo_options['woo_post_content'] == 'content' || is_singular() ) wp_link_pages( $page_link_args );
    ?>

Right now the output lo开发者_开发百科oks 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


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 with the_date() and the_category() functions, as they itself return echoed data.

0

精彩评论

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