WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In one part of my site I am displaying custom field data like this:

<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'info', true);
?>

This works ok but it strips any paragraph breaks out and displays it all as one big block which makes it hard to read.

So how do I make it respect the paragraph breaks?

many thanks in advance!

James

share|improve this question
up vote 2 down vote accepted

this obviously depends on the content of your 'info' custom field; generally, you could try:

echo apply_filters('the_content', get_post_meta($postid, 'info', true));
share|improve this answer
1  
Perfect! many thanks :) – James Olney Oct 10 '11 at 10:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.