Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am adding tinymce edior with new wp_editor() function on theme option page. On submit the theme option sends data to option.php where it saves. But tinymce doesn't seem to convert the line breaks into <p> tags as we see in the post and pages from the edit page. Other styles and htmls that I add from the editors are okey.

Do i have to use any filter on it before it saves?

I am showing the content with a echo.

<?php echo theme_option('homepage_content'); ?>
share|improve this question
1  
Paragraphs aren't added to the content, they're added on display only, your issue is with how you display the data you're saving, what are you using to display the data? Just a regular echo? Something else? Please add those details to your question. –  t31os Dec 21 '11 at 13:07
    
@t31os: updated my question. –  Sisir Dec 21 '11 at 13:21
add comment

1 Answer

up vote 3 down vote accepted

If you want the contents of an option, variables, or anything for that matter to be treated like post content you'll need to call the post content filters.

<?php echo apply_filters( 'the_content', $your_var ); ?>

Your data is then treated in the same way as post content is, inline with the code sample you've posted, the call should go like this..

<?php echo apply_filters( 'the_content', theme_option('homepage_content') ); ?>

Hope that helps. :)

share|improve this answer
    
working now.. I am so dumb when it comes to filter :( Thanks anywayz! –  Sisir Dec 21 '11 at 13:50
add comment

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.