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 to customise the output of the WP image gallery shortcode from a plugin?
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- What is the best page ordering plugin that works well with WPML? [closed]
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- How to parse nested shortcodes?
- jQuery plugin only in one page/post
- How to create a Page alias in WordPress
- change plugin shortcode function [closed]
- How to extract images of post and pages excluding header and logo image in wordpress?
- Dynamic HTML not displaying at respective place
- Short code for Venues
- Automatically adding post and pages to new blog setups
- Capitalize All Titles and Headlines in Chicago Style
- Shortcode doesn’t work if I directly paste its function in a template file?
- Add custom variable in Contact Form 7 mail body
- get shortcode value
- Display content from custom post type if match to main post category
- How to generate CSS from a shortcode within a plugin
- Storing Options in a Shortcode
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Override global query results without hooks
- How to put JQuery/Ajax inside shortcode?
- 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?
- Trouble with editing template for “List category posts” plugin
- WordPress function not being called from jQuery method
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Create page from plugin, but have it completely hidden
- How to add subcategories to the blogroll?
- Use $_GET inside a shortcode print empty Array
- My plugin won’t return anything [closed]
- Render Modula Plugin Shortcode On Ajax Request
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Deactivate JS Script in Plugin Shortcode
- Shortcode not getting replaced
- Plugin that provides the [edit] shortcode?
- plugin wraps the entire content
- Shortcode Attributes to Return different $_POST
- How to change shortcode’s default theme?
- Is there a way to convert shortcodes to html content?
- Loop in elementor custom widget not working
- get_users(); Is an Undefined Function When Used in Cron Job
- Get param from shortcode in plugin function
- Inserting shortcode in href – any ideas or workarounds?
- Shortcode and variable
- Filtered content appears in the excerpt
- Is there existing plugins to “Click-to-Launch” embedded Flash / SWF content?
- Elementor Pro display featured image on section -> style -> image using shortcode
- Elementor Combined all Sections into 1 Text Editor
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
- WordPress Frontend Page using Plugin
- Shortcode show error while editing post
- Get Shortcode output to database for static post_content
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- Issue Saving Posts That Contain Shortcode
- Powerpress upload a podcast without creating a post for it
- Using Shortcode Result In Custom HTML Block (Using Google Sheet JQuery Result As NumScroller data-max)
- Allow a page to be edited by a specific custom role
- How to use plugin’s shortcode in custom design? [closed]
- WP Plugin CSS not being applied to page
- How to disable users to view Other pages
- Get content and send to 3rd party
- Create post loop that displays pages by cat ID
- History of page, interval of years
- Choose default template for a page with code
- Find all strings between an enclosing shortcode
- Hide some shortcodes on posts from back-end
- custom template only for content
- Trouble implementing python on WordPress
- Is there a function to search for a wildcard value when calling a shortcode?
- Get page content by ID (from a plugin)
- How to display single arbitrary facebook post with a shortcode?
- Multiple level shortcodes
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- apply_filters to content but ignore shortcodes
- How to load a plugin when doing an Ajax call? [duplicate]
- Is it right way to create shortcode?
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Get content or excerpt of top rated votes @GD-Star Rating? [closed]
- is ther a plugin that will hide/show content for a scheduled period of time? [closed]
- Creating Features List in WordPress Post
- I am experiencing difficulty fulfilling client request
- Change page content based on dropdown selection
- Shortcode to do math with url variables
- How to get URL param for pagination in shortcode?
- Buffered output in chunks and shortcode – how do I achieve that?
- Page with redirect