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 using $page = get_page_by_title('name'); to get the contents of a page. When I echo $page->post_content; none of the content is wrapped in p tags like it is when run threw the normal wordpress loop using the_content(). Is there a different way I should get this data so it will contain the proper tags?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You can apply the content filters to $page->post_content like so:

echo apply_filters('the_content', $page->post_content);
share|improve this answer
    
Awesome. Works perfect. Thank you. –  jppower175 Feb 6 '13 at 0:41
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.