Set postdata after get_post to set their data.
$id=12;
$post = get_post($id);
setup_postdata($post);
$content = apply_filters('the_content', $post->post_content);
echo $content;
wp_reset_postdata();
Related Posts:
- apply_filters(‘the_content’, $content) vs do_shortcode($content)
- Insert Custom HTML After Shortcode
- Format content value from DB outside of WordPress filters
- add_filter to the_content after apply_filters
- How to wrap pattern-matches from the_content in [wiki]-shortcode tags
- the_content and is_main_query
- How to appending to the_content using add_filter with custom post type?
- Filter specific shortcode output?
- WordPress Internal @ Mentions
- Where to hook into post content?
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- add_filter and changing output captions of image gallery
- Add whitespace between Chinese and other letters
- Hook added to the_content seems to be called multiple times
- Get excerpt from $post->post_content
- Add Class to Specific Paragraph of the_content()
- add_filter for specific pages
- Using variable from one filter in another filter
- apply_filters(‘the_content’, $content) alternative
- What effect does the_content filter have on performance?
- How to add attribute to output with wp_video_shortcode add_filter
- Search content for shortcodes and get parameters
- How can I display image metadata?
- Change default settings used by gallery shortcode
- How to apply content filter permanently?
- How to prepend text to the_content, but after img/shortcode
- Shortcodes not resolved in AJAX call response
- Use content custom filter for all shortcodes
- What is the filter hook for custom fields content?
- how to remove filter from wordpress shortcode output
- What functions are included in apply_filter(‘the_content’)
- Return array of images after content
- Nested calls the the_content filter
- Error when overriding only some audio shortcode HTML output
- How to use shortcode attribute in separate function
- Editing
- the_content filter – checking the post
- Wrap h1-h6 in a div
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- Function the_content not working
- ‘the_content’ filter removing html tags from post content
- Post Content, Special Characters and Filters
- Shortcodes — Using add_action, add_filter in the shortcode
- Filter on the_content doesn’t update the content being searched via register_rest_route
- Remove Content Filter
- How to pass variables to custom filter from multiple functions
- tag removed not using a filter
- How to filter backend post list showing only posts having a shortcode
- Replace audio links with jplayer using the_content filter
- Add a div of content within the_content after a certain block
- Can i use multiple ‘the_content’ filters?
- How can I return shortcode output to the top of the content?
- get_post() containing gallery is outputting an unmatched closing div at the end of the content
- the_excerpt filter doesn’t work as expected
- Load Posts’ individual body content on index starting at char 200 of each post
- Excerpt is being added above the content, but it should be after it
- run shortcode in excerpt of single custom post type
- What is the earliest hook to modify post content?
- Filter everything from content except output of a shortcode
- Something is filtering my shortcodes… Can’t figure out what
- Filter content for get_the_content()
- How to use do_shortcode_tag to modify the output of a shortcode?
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- How to change dynamically page title according to variable data?
- How can I filter tag_description()?
- WordPress removing slashes from shortcode output
- How can I get the default content of WordPress post?
- Email Obfuscation: Is antispambot() Acceptable? [closed]
- How to remove shortcode(s) from WYSIWYG Page editor for Non Admins
- alternative to the_content filter
- Shortcode / plugin with custom (flexible) output
- Filter Shortcodes when using get_page
- Parse a shortcode differently based on on what it’s nested in
- Need to return shortcode text instead of the output
- Filters on the_content with plugins, pages and shortcode
- Scanning for custom embed and prefetching
- How to Create custom block for displaying information in content section which act like shortcode
- get_post() with filters applied
- Override wordpress audio playlist
- Add Index to Item in WordPress Gallery
- create a shortcode with acf including a filter
- How to take shortcode and content separately from a page?
- Set Microsoft Word links to open in new window/tab
- How do I isolate the reason a wordpress filter is not running?
- Apply a filter str_replace on specific caracters array in the_content()
- Auto-generated excerpt with shortcode and read more button/text link
- Shortcode to eliminate and replace with
- shortcode function outputs multiple anchor tags
- apply_filters to $GLOBALS
- changing size image within the content
- Change shortcode output (filter?)
- Can’t get content of all (19) posts – Incomplete Chunked Encoding
- Is it possible to include the add_filter() function within a shortcode function
- Activate short codes for all post queries?
- Add class to all parent elements inside the_content
- filter on the_content stopped working when I updated to WP 3.6.1
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- post->post_content filter
- Replace image scr with it’s surrounding href
- After adding filter to plugin’s code, post’s content doesn’t display