Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 The WordPress Thread, Anything related to Wordpress

views
     
silverhawk
post Jul 1 2010, 03:14 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(sunsuron @ Jul 1 2010, 02:23 PM)
» Click to show Spoiler - click again to hide... «


How about a adding a special token like | to represent a line break? For example:

CODE
foo|bar|baz


CODE

$_post = & get_post( $id ); // $id is the attachment ID (integer)
$desc = $_post->post_content
$lines = explode('|', $desc);
echo implode( '<br />', $lines );


or

CODE

$_post = & get_post( $id ); // $id is the attachment ID (integer)
echo str_replace( '|', '<br />', $_post->post_content);

*
Why not just find where in the template that's being outputted and use nl2br() ?

 

Change to:
| Lo-Fi Version
0.0154sec    0.35    7 queries    GZIP Disabled
Time is now: 20th December 2025 - 03:03 PM