I found that this can be done simply by using WordPress’ Page editor. Nothing else is needed:
- Compose the content in WordPress’ Page editor
- Save (but don’t publish)
- In your code, retrieve the saved content
$id=47; $post = get_post($id); $content = apply_filters('the_content', $post->post_content); echo $content;
$title="page title"; $page = get_page_by_title( $title ); $content = apply_filters('the_content', $page->post_content); echo $content;
Note that apply_filters is used in case there is a plugin somewhere that wants to “apply filters” to the_content – it’s good for forwards compatibility.
Related Posts:
- Visual Composer Data Source?
- How to get the active theme’s slug?
- Preserve custom URL parameter on more pages
- if plugin is active? check if plugin is enabled or not?
- Making plugin unique to not conflict with plugins with the same name
- How to store ACF custom fields data in a custom table
- Trying to disable plugins doens’t work
- Errors while using ajax from external wordpress page
- shortcode doesn’t work
- Setting up widgets in wordpress with a unique ID for the after_title argument
- post expire after x days
- How to get all events from ‘All in one Events calender’ plugin in JSON format?
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- Make specific products accessible only to a user role in WooCommerce
- Getting selected (highlighted) html from the Visual Editor on Edit Post page?
- Custom form action to handle data inside a plugin
- WP Post Template – Templates in own folder
- Apple push notification doesn’t work
- How to add equivalent of php include to one page (as plugin?)
- Override Plugin Script Fucnction in WordPress
- Image upload and download from front-end
- Parse error: syntax error, unexpected ‘new’ (T_NEW) in /misc/41/000/204/381/9/user/web/ragami.net/wp-settings.php on line 219
- Ajax call returning 0
- Conditional attributes and logic per product category
- Using Wishlist Member and I need to access a user’s status
- Why namespaces are rarely used in WordPress plugins?
- Subdomains with almost the same content
- How to add wp visual editor in a custom widget?
- Using window.onload with Ubermenu
- What is @Action in WordPress?
- How to include this jQuery File in wordpress?
- PHP Error When a plugin is active
- Include a php file from another plugin
- Getting taxonomy images to display on single-post with their terms
- wp-mail attachment is not sent for no reason?
- Custom shortcode for displaying user based on a role parameter
- How can I fetch data from another website to my wordpress website with mysql database
- Save user total active time after login in wordpress [closed]
- Switch from wp-cron to a server cron job
- Calling a save function from a “submit” button
- Wp Debug Enabled True Notices and Warning
- Theme Functions run a function upon activation or preview
- Is this plugin safe to run?
- Custom Plugin scripts from admin working in frontend
- WooComerce Deposit: set specific shipping method and quantity based deposit amount
- Unexpected add action function in WP plugin
- get_post_meta shortcode returns empty field
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- How to add a prefix to a WordPress post preview url?
- i can not access the post in custom template of my wordpress plugin
- How to get a specific string from a url
- WordPress rewrite rule depend on meta values not ids
- location lock wordpress website
- Easiest way to load/fire a handful of functions, IF checkbox is checked?
- How to avoid the 403 Forbidden error in a WP Plugin with Ajax and PHP
- Problem with wordpress has_action() function
- Offering a freemium plugin (a free version + paid version)
- Why is my form going to frontend on html form submission present on the php files inside my custom plugin?
- post id or permalink auto-incrementing number and reset everyday
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- WordPress logout appends cache/all/index.php to the site_url()
- Reverse count page view and show on other page
- Change (replace) word in metabox
- Limiting buddy press features based on membership level (PMPro)
- Register setting on plugin activation
- WordPress environment not loading properly
- How to remove a css class for any wordpress page
- Creating wordpress admin page panel [Theme Option]
- WordPress not displaying information on post sent from custom admin form
- How to replace native comment_count with Comments Evolved aggregate count
- export high ress images to pdf
- Embedding code snippets in posts with indentation
- Autoloading a PHP class – working outside, but not inside WordPress plugin
- Calling an custom field from theme option at the frontend
- custom url with custom post
- Saving an array to get_options
- Variable passed to each() is not an array
- Working on fixing wp-front-end-editor, encountering undefined index
- MySql Query for WordPress
- Some of my php is rendered only when logged as admin
- Shrinktheweb plugin problem
- Pulling sub-site content into specific pages
- Issue with custom plugin
- Help me with my first very basic plugin
- Getting Post Permalink Outside of Loop Not Working
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- Undefined constant error in pluggable.php
- How to create post comparison in wordpress
- White Screen When Includding A Folder With PHP Files
- WordPress create permalink structure for custom post type with userid
- wordpress jquery is not defined because the head tag is empty
- Two sites one PC
- PHP if url extension action=discussion condition use [closed]
- how to show selected options drop down menu values in attributes field in after saving post.php
- Can’t use updated variables in handle function
- How to get URL param for pagination in shortcode?
- Is there any WordPress Plugin that provides video editing from front end side? [closed]
- Accessing Correct Database to Create REST API Endpoint
- How do I replace a logo image that’s hard-coded into a plugin’s logo.php file?