$content = $post->post_content; with formating
If i get your question correct, you want the post_content formatted like the content put out by the_content, right?
Change your upper code like this:
global $post;
$content = apply_filters('the_content',$post->post_content);
This does everything to your content that would be performed when outputting it by the_content();
If you only want the p and b tags, you can use wpautop($post->post_content)
instead.
Related Posts:
- post_content with line breaks
- Is it possible to handle a specific section of a post separately?
- the_content inside my own theme does not retain line breaks / enters like in the admin
- How to get ‘post_content’ without stripping tags?
- Only show content before more tag
- remove tags from the_content
- Why is the_content() not displaying the content? [closed]
- Insert Custom HTML After Shortcode
- Content over 10,000 characters won’t display with the_content()
- Heartbeat API oEmbed
- Apply the_content filter for specific post types only
- How to add an inline style to the tag outputted in the_content() using PHP?
- Word limit in post_content after more tag
- WordPress adding tags into plugin content
- Formatting post content to exclude gallery
- Format content value from DB outside of WordPress filters
- Is it possible to change the contents of “the_content()”?
- How to encode post content as JSON?
- How can I show the actual content of Posts page because the_content() is showing all blog content?
- preg_replace Remove comment text in content
- tag the_content()
- WordPress replacing all line breaks in comments with “rn”
- Proper use of the_content filtering
- put the content of a single post into og:description
- Output the_title() inside the_content()
- the_content is always surrounded by paragraphs (how to disable or remove them)?
- Filter the_content() in the Quote Post Format to Display Quotes
- WordPress get_the_content get child element like p value
- How to make search and replace in content through php
- Strip links from the_content
- Concatenate a Function to the Post Content
- How to change the position of Jetpack sharing icons? [closed]
- embed the_content
- Hook midway through the_content();?
- Appending code to the_content
- Force Balance Tags not working
- Missing content in Pages only
- Add Attribute to p Tag of Post Content
- Changing Image Size In The Content tag
- limit how many words show up in the_content on index
- Problem on the_excerpt(); function
- How can I display “read more” without any other post text?
- Stop wordpress from adding html tags but not remove my own tags?
- the_content() printing site title after page/post title and before its content
- WordPress adding content into different sections
- How to keep before/after text inline with nl2br and the_content()
- removing tags around img, iframes and also scripts
- Should I find/replace values in the_content?
- How to limit the characters shown on the page – get_content
- Extract a link in the_content()
- Content DISAPPEARS when simply adding normal text for ONE POST ONLY
- How do I show current post content in the header?
- strip_tags in get_the content
- custom page with post content using read more
- Insert div after h2 in content
- the_content() returning unexpected div wrappers
- How can I output the content of the page using this code?
- filter h1 tag to add a word at the beginning of the text
- the_content() brings the medium size image [closed]
- Checking post content for a shortcode, but content is being returned as empty
- How can i specify the size of the image rendered by the_content();?
- IF Inside A Function For Content Filter [closed]
- content and excerpt not displaying
- Get Content Limit?
- Append data to the_content within the database (not using filter)
- the_content returns blank when adding SEO details
- how to include page content to specified length & then “read more” link
- How to add multiple the_content or something like that?
- Using str_replace on the_content and the_excerpt, but not working on archive index pages
- Get specific Blocks from Post
- Is there a way to get rendered html content of a WP post after updating?
- How to show Social share buttons outside the post?
- how can i take wordpress post as embed?
- Remove pre and code tags from WordPress
- auto link word link in content
- How to parse any content which was added after the working out filter ‘the_content’
- One Content Filter To Rule Them All
- Extract links inside embed tags in WordPress
- Looking to limit the number of characters on my post page
- after setup_postdata, the_content() only displays text before the read more tag
- Remove P tag from images if aligncenter class is set
- Call the content help
- Remove a div with ID from the_content WordPress
- wp_content text length and displaying ‘more’ for the full text
- add css to only body text
- Modify Ixion Theme to Include Post Excerpt On Main Page
- Cannot Find Hook that is changing the_content()
- get_post_fields as an excerpt
- The_content is different from category archive to other pages [closed]
- Add class to all parent elements inside the_content
- Read more link for blog listing page
- Add read more to the_content
- pre_get_posts returning unformatted page
- How to replace text in hompage only
- How do I remove the title from the_content
- Exactly where I have to insert get_next_post_link() in a post?
- Does WP have a hook for the use of wp_trim_words?
- I want a part of the_content be under custom post types
- Find and replace weird characters in the_content [closed]
- How can I customize the_content(); output? [closed]