Well, you can do this with much less code:
echo apply_filters( 'the_content', get_post_field('post_content', $post_id) );
You can also use get_post_field
function to get other fields like post_title
, and so on.
Related Posts:
- Can’t get custom posts of taxonomy to show
- Insert content of a post into another
- How to have sample page for each new register users in a membership website
- Where to find the code used to render a page that has a shortcode and a template defined?
- Add Content to Content()
- Loop returns the current page’s permalink and guid instead of the post in the loop
- Price comparison table based on Custom Post Type?
- Page takes on two different formats
- Multiple calling javascript from shortcode in one page
- Fake Single WordPress Post (Page) Loop
- Shortcode returning specific content of a post
- How can I create a custom shortcode that will return a custom post type by ID?
- Use wordpress functions in another PHP file
- Plugin Handle URL With Custom Theme
- Allow users of my plugin to define their own shortcode rather than use mine?
- Adding Shortcode to Text Widget
- How to put JQuery/Ajax inside shortcode?
- wordpress prevent multiple shortcodes
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Can someone please tell me what is wrong with my plugin?
- Display post shortcode content in the sidebar?
- Trouble with editing template for “List category posts” plugin
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- WordPress function not being called from jQuery method
- AddToAny shortcode in the loop
- How to add an automatic refresh in WordPress for a Page/Post or an embedded OneDrive/Excel HTML Code?
- How to delete page by deactivating plugin
- How to fix wrong attribute error for Visual Composer Grid Builder?
- WordPress web pages keep getting deleted (moved into the trash) by themselves
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- Making a Template for a CPT created by a plugin
- Run plugins only on certain pages
- (FES EDD) New vendor submission page is blank
- creating html reusable blocks via shortcodes
- add_shortcode is not working in plugin where others are working
- Single API call exposed via shortcode with params
- SEO Friendly URL on dynamic product page produced via shortcode
- Shortcode Plugin to dynamically build a shortcode via `do_shortcode` not working
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Nested shortcode functions accessing variable
- Calling an attribute from a plugin shortcode
- Best place for short bio,image and button [closed]
- WordPress plugin/theme or other wayout to create portable pages?
- php page not found for plugin options menu
- Changing page URL and connect newsletter to MailChip
- Problem with the Loop – want to limit the access to three free articles
- accessing wp.media api from a tinymce plugin
- Creating shortcodes in plugin
- Visual Composer shortcode for child theme dir
- get_post_title is not working on homepage
- Some code in shortcode function being ignored
- Front end inline editing?
- WordPress page and plugin list using sql query
- Create page from plugin, but have it completely hidden
- How to create a custom shortcode based on the layout?
- Unable to add TAB character to post?
- How to add subcategories to the blogroll?
- plugin shortcode output
- How do I write an inventory list plugin that creates dynamic details pages?
- Can I allow certain people to add/edit pages within a parent?
- How to Create a shortcode to this php function
- Inject HTML meta tag inside wordpress tag using add_shortcode
- How do I apply style to each category of a list?
- Create shortcode to echo javascript
- Proper way to replace the_content only for pages created by custom plugin
- Add menu page issues (permissions & position)
- Redirect to another page using contact form 7? [closed]
- What is @Action in WordPress?
- Display Custom Field Value on Admin Page Column
- Custom Shortcode Broken in WordPress 3.1
- Would Gutenberg be considered a PlugIn?
- Use $_GET inside a shortcode print empty Array
- I need help locating a URL that is on my site map, but that I can’t find in my WordPress dashboard
- Namespaced shortcode?
- WordPress Plugin manipulate have_posts()
- Where are theme codes located for WordPress?
- Show author on every sub-page
- Get User_id outside wordpress,
- My plugin won’t return anything [closed]
- Calling the_excerpt from inside a plugin template file
- Recent posts per category loop?
- Anyway to convert a plugin to become a shortcode?
- Render Modula Plugin Shortcode On Ajax Request
- Shortcode to update user meta
- Import Instagram post to WordPress blog post
- Why shortcode always displayed after footer not in body
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- using do_shortcode
- Why am I unable to load scripts in head in plugin?
- Bulk update wordpress posts
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Deactivate JS Script in Plugin Shortcode
- How to get a list of bundled products using wp_query in woocommerce
- plugin shortcode not working on ajax request call
- Displayed content disappears when adding attributes to shortcode
- Modify page title and subtitle with a plugin
- One sub site is slow while all others load fine, same theme & plugins [closed]
- How do I pass custom shortcode-extracted variables (taxonomy) into a query function for WordPress RoyalSlider?
- Shortcode not working after move wordpress website files
- Shortcode not getting replaced