Add end mark at the end of every article

The end of the_content() is a </p> tag. It sounds like you want to include your end mark before that last </p> tag. If so, you need a function that filters the_content(). Something like: function yang_end_mark( $content ) { $content = substr_replace($content, ‘<span>&#128282;</span></p>’, strrpos($content, ‘</p>’), strlen(‘</p>’)); return $content; } add_filter( ‘the_content’, ‘yang_end_mark’, 25 ) ;

How to use TOC with ACF?

You can use the the acf/save_post action to copy the content from your custom ‘full_text’ field over to the normal post content field, so it can automatically be accessed by toc+ and other plugins. add_action( ‘acf/save_post’, ‘wpse199256’, 20 ); function wpse199256( $post_ID ) { global $wpdb; $post = get_post( $post_ID ); $wpdb->update( $wpdb->posts, array( ‘post_content’ … Read more

custom template only for content

You can’t override template parts. Even if you could, you would have no way of knowing what template part you’d need to replace. A theme is only required to have an index.php file and there are no restrictions or naming convention for template parts. Your options are to create a full template and leave it … Read more

Regex works in regexr, but not if I filter content [closed]

Per comments, it’s best to use single quoted strings for regexs in PHP (then only backslash and single quote are special), and only backslash as necessary, eg in this case $url_regex = ‘/href=”https://wordpress.stackexchange.com/questions/219419/(http”https):\/\/.+?”https://wordpress.stackexchange.com/”; (leaving out the positive lookahead which isn’t needed here).

I am not seeing any content within WordPress after migration?

Last time something like this happened to me it was because there were funky characters in the post content (which came, I think, from a database encoding difference between the source and destination databases). Anyway, that’s where I’d look first. Use phpMyAdmin (or your favorite db tool) to check the post_content column of your wp_posts … Read more