You can run the the_content filters on your data.
foreach ($results as $r) {
echo apply_filters('the_content',$r);
}
That should get you the same formatting as in your posts.
Related Posts:
- Completely strip any hidden formatting when pasting into TinyMCE
- Modify site URL via functions.php of a theme
- How to center oEmbedded content
- Mystery line break
- Database & Post Search
- Displaying posts on a page that have been assigned a value in a database
- Add HTML to Page Content
- WordPress hooks/filters insert before content or after title
- Query WP REST API v2 by multiple meta keys
- Removing Image and Caption Dimension Attributes
- is it possible to add “extra” table nav to edit-tags.php screens?
- How to apply the “retrieve_password_message” filter?
- Remove left alignment option in core/image block
- How to change/rewrite the lost password url?
- add_filter multiple times with different addon functions?
- How can I find out what an `apply_filter` call is actually doing?
- How to apply content filter permanently?
- Customize the “Registration complete. Please check your e-mail.” message on WP 4.0
- posts_groupby problem
- Remove classes from post_class()
- Replace a part of url generated by get_term_link
- Error when overriding only some audio shortcode HTML output
- Run oembed separately outside the_content()
- Hook Into the_content Filter For JSON API Only [closed]
- apply_filters(‘the_content’) – make it ignore shortcodes?
- Remove style `?ver=` from `/wp-admin/upgrade.php`
- Add attribute to script loaded by the theme
- theme_page_templates not working
- Filter custom post type using multiple taxonomy dropdowns
- Add new post with predefined / preset date
- Building a request processor for multi-page forms, etc using $_GET requests
- add img class to native wordpress galleries
- Get Posts updated or published within the last x hours
- the_content filter together with require_once returns 1 instead of the content of the included file
- Missing Argument 2 for apply_filter
- How to get a single hook from wp_head()?
- WP filter to alter admin CSS styles?
- preview_post_link for Custom Post Types
- Filter an array with a callback – for single & multidimensional arrays
- Detect when gutenberg editor title is available in Dom after editor load
- How to apply a filter to an ACF wysiwig editor field output?
- Why this filter hook is not working when passing parameters?
- Are href attributes of a elements filtered on output to add the current path?
- Is it possible to bind a function to a filter hook via Ajax?
- Add a filter to an action [closed]
- Change the template when the user is not logged in using page_template filter (it does not work)
- Regarding post text filtering
- Add Filter not working with get_posts
- How to Prevent WordPress to encode html in post?
- Why template_include filter does not work with WPML plugin?
- Hide Posts In Back-end/Admin Based On User’s (Pseudo) Privileges Controlled by ACF
- Filter Pages by Custom Field (ACF) in admin area
- Filter posts by meta data using custom query
- Most performant/functional way to add actions/filters?
- Remove tags without a specific meta key from “choose from the most used tags”
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Register users by e-mail
- Making an add_filter() call from within an add_filter() call
- automatic title through filter
- Filter causing loss of _wp_attachment_metadata
- Action hook to control access to certain parts of my site
- Finding actual functions added to hooks and filters
- Buddypress Filter Multiple Activities [closed]
- How to apply filter on get_the_post_thumbnail()
- How can I tranlslate post date in italian?
- Use alternative front page if cookie is set
- How do I check if I can use the allowed_block_types filter?
- Having wp-admin on different domain
- Use a functions in functions.php to remove a string for template theme
- Setting the page title in a plugin, but not outside my plugin
- how to output HTML tags in post_content and not as plain text
- oembed_dataparse filter not running at all for standard YouTube embed
- Security question – Display a General Custom Login Error Message
- Action for opening attachment or manipulating all attachment links
- Filter wp_mail based on content type
- Add filter conditionally to a page
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- mu-plugins body_class filter not working
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- Post filter Month dropdown at front-end like wordpress backend
- shortcode function outputs multiple anchor tags
- changing size image within the content
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- Show child theme for users on specific IP
- Remove action added from class
- wp.getPosts with status = ‘trash’ using node.js
- Is there a way to overwrite a filter used in canonical.php?
- How do I remove certain HTML elements with specific classes from the feed?
- Adding an orderby filter, casting postmeta with multiple keys
- Identify admin/logout and more filters
- Filter and Search
- Filter posts by multiple checkbox categories
- Remove pipe in views admin page filter
- Add a filter conditionally based on frontpage
- custom post filter based on Visitors country
- How to correctly override a filter?
- Is there a way to check if the ‘wp_sitemaps_enabled’ is true or false?
- Accidentally created 2 pages, same name. Changing permalink on one changes both