Different query result on local and server

Can you try using another date format? Example: foreach ($blogs AS $blog) { switch_to_blog($blog[“blog_id”]); $yesterday_today = array( ‘order’ => ‘ASC’, ‘orderby’ => ‘date’, ‘date_query’ => array( array( ‘after’ => array( ‘year’ => date(‘Y’,strtotime(“-1 days”)), ‘month’ => date(‘n’,strtotime(“-1 days”)), ‘day’ => date(‘j’,strtotime(“-1 days”)), ), ‘before’ => array( ‘year’ => date(‘Y’), ‘month’ => date(‘n’), ‘day’ => date(‘j’), … Read more

Allow user to add the php code in wp_mail()

I would just use str_replace() to handle a “pseudo” shortcode. Something like this: $body = sprintf(‘Hey {{username}}, your awesome post has been published! See <%s>’, get_permalink($post) ); // Add replacement values to the array as necessary. $old = array( ‘{{username}}’ ); $new = array( esc_html($user->display_name) ); $body = str_replace( $old, $new, $body ); // Now … Read more

Premature end of script headers: wp-mail.php?

Post by email does not work by accessing wp-mail.php. You need to go to Settings > Writing on your website and enter POP3 credentials for whatever email address you plan to use. After that, any email you send TO that email address will be parsed and posted.

Email always ends up in spam

There are a wide variety of things this could be, so any answers to this question would be speculation. Keep in mind, it’s the email that gets marked as spam (and the details of the sender, domain, etc), not the code that generates the email. That being said, I would investigate the sender information first … Read more