global $post inside plugin query messes up every new post page in wp-admin

You have two problems in your code. You use $post as a iteration variable which is an habit best avoided You use setuppostdata which changes the global $post without you using any function that actually needs it your loop should look like foreach ( $pp_query as $p) : $pointer_query[] = array( ‘id’ => get_post_meta($p->ID, ‘_sbap_pointerid_text’, … Read more

Form not working as it should in WordPress, but in a normal HTML site it does

So I finally found the solution to the problem. It was in the validate.js function. I corrected the error by calling the outside functions of validate.js and jquerry: script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js” script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js”

Relative post date in recent posts list

You don’t generate a WP Loop using wp_get_recent_posts() so get_the_time() won’t pull the post date. The post date is available within the array wp_get_recent_posts() returns though: $recent[‘post_date’]. Or you can use the modified date: $recent[‘post_modified’]. This works (tested on my dev site): <?php $args = array( ‘post_status’ => ‘publish’, ‘numberposts’ => ’30’, ‘tax_query’ => array( … Read more

Wp_mail doesnt work

f you’re using anything that allows you to configure SMTP within WordPress, take it out. Then put everything into a function: add_action(‘init’,’delay_until_init’); function delay_until_init(){ // call wp_mail() here }