Can I ‘order by’ date that is in a text field?

Your Problem isn’t that big. As your meta data is stored in the Y m D format, you should be able to just sort by it (I am going to assume that the format uses leading zeros). You just add “meta_key” to your query arguments like this: $args2 = array( ‘post_type’ => ‘joblist’, ‘post_status’ => … Read more

Custom Post Status 404 URL

this function changes the post to draft, you only have to call it and pass the post id where you want the function to work function postToDraft($post_id){ $post = array( ‘ID’ => $post_id, ‘post_status’ => ‘draft’ ); wp_update_post($post); }

Passing in MySQL prepare statement parameter separately throwing error

$query = (“SELECT * FROM <tablename> WHERE user_id = {$user_ID}”); // string variable $stmt = $wpdb->prepare($query); Say your $user_ID is 9, this will get evaluated to: $query = (“SELECT * FROM <tablename> WHERE user_id = 9”); $stmt = $wpdb->prepare($query); and finally becomes $stmt = $wpdb->prepare(“SELECT * FROM <tablename> WHERE user_id = 9”); Now it is … Read more