Search and replace in post content

Okay, this always seems to happen to me. I spend ages looking for an answer and finally decide to give up and post here and then one more search finds enough to solve it. Anyway, this is what worked for me: update wp_posts set post_content = replace(post_content, ‘[/tab] [tab title=”1024×576″] <table class=”screenshot-table”>’, ‘[tabby title=”1024 x … Read more

How to implement content from external database into WordPress text page? [closed]

You should write a plugin, or compact the code needed for this in a child theme functions.php. About pulling data from external databases: the simplest way is to use php built-in functions. I would proceed this way: Register a shortcode to place your table wherever you want in WordPress, you probably want to pass some … Read more

How to display content from post_parent

As stated by the other answer, you can not pass an ID to get_the_content() function. You could fetch the post using get_post(), but there’s also another handy function that you can use to fetch the content: The get_post_field( $field, $post_id, $context ) function is what you’re looking for: $content = apply_filters( ‘the_content’, get_post_field( ‘post_content’, $post->ID … Read more

Format content value from DB outside of WordPress filters

There are a few filters and actions here that run. You’d need to look at the code and figure out what/how to utilize these. https://codex.wordpress.org/Function_Reference/wpautop https://codex.wordpress.org/Function_Reference/wptexturize https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content https://developer.wordpress.org/reference/functions/do_shortcode/ https://developer.wordpress.org/reference/functions/unescape_invalid_shortcodes/ https://developer.wordpress.org/reference/functions/get_shortcode_regex/

Formatting post content to exclude gallery

i used a function from @HOWDY_MCGEE ‘s answer plus some rewrites and attahced is my working code. functions.php: function pw_show_gallery_image_urls() { global $post; // Make sure the post has a gallery in it if( ! has_shortcode( $post->post_content, ‘gallery’ ) ) // return $content; return ‘nadagif’; // Retrieve the first gallery in the post $gallery = … Read more

Is it possible to handle a specific section of a post separately?

You can make use of featured images as suggested by @gmazzap in comments. This featured image will not be included in post content. However, if you already have your images included in post content, then you need to strip the post content down in two parts, as you’ve said in your question. I have two … Read more

WordPress REST API – JSON “Rendered” Content Incorrect

The content that you are referring to is coming from the Elegant Themes Page Builder plugin on that site. The page builder uses WordPress Shortcodes to render the content on the WordPress site. However, when you use the REST API, the content is pulled from the WordPress database and the shortcodes are not processed/rendered first. … Read more

How to embed page content in a blog post

Create a shortcode to embed the content. This will always be synchronized. Sample code from an older project. Just updated. ๐Ÿ™‚ GitHub: https://gist.github.com/3380118 ยท This post in German (auf Deutsch) on my blog. <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 Embed Post Shortcode * Description: Embed any page, post or custom … Read more