How to show NEW post content in post editor?

try wp update post function: // Update post 37 for example $my_post = array( ‘ID’ => 37, ‘post_title’ => ‘This is the post title.’, ‘post_content’ => ‘This is the updated content.’, ); // Update the post into the database wp_update_post( $my_post ); https://codex.wordpress.org/Function_Reference/wp_update_post

is_preview() always return false

is_preview() should return true is it is a preview. Did you try the following on the page.php? if(is_preview()){ echo “preview” }else{ echo “no preview” } to check if the is_preview() function is working? EDIT2: You could work your way around it and check for: if($_GET[‘preview’] == true){}

How to get the date of all blog posts

If you want to get the dates of all blog posts then you’ll need to perform your own query and loop that. This is the query: <? $posts = new WP_Query(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1 )); ?> Now you’ll need to loop those posts like so: <? if( $posts->have_posts() ) : while( $posts->have_posts() … Read more

ACF Field to set Publish Date – Post Duplication upon Update

Drew, one thing about your code above is that the word dateAllergy should be in quotation marks like. I’m not sure of that is the problem but it’s worth changing. $datefield = get_post_meta($post_id, ‘dateAllergy’ ,true); Also, I just noticed that your $post_id variable will be empty too. You should change that to $post->ID. That would … Read more

Enclosing shortcodes create line breaks

If you want to just strip the <br /> from the content then you could modify your function to replace that signature with an empty string. It feels like a dirty hack, but it’s working for me. It’s worth noting that my Chrome tools show <br> but the actual code is rendering <br /> which … Read more

wordpress not saving form code in code editor

Embedding PayPal code into the text editor is always a little risky due to the layout of html elements ‘PayPal style’ vs the layout of html elements ‘WordPress content style’… both are trying to ‘think’ for you a little bit to make your life easier, but as a result the formatting can go whacky. As … Read more