WordPress api post image raw data without being blank in media library

I found a solution ! file_put_contents($filepath, base64_decode($data)); // Make sure the image exist if (!file_exists($filepath)){return;} // Load the image $file = file_get_contents($filepath); // Get the filename $filename = $image_name? $image_name : basename($filepath); // Initiate curl. $ch = curl_init(); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); curl_setopt( $ch, CURLOPT_URL, $url .’/wp-json/wp/v2/media/’ ); curl_setopt( $ch, CURLOPT_POST, 1 ); curl_setopt( $ch, … Read more

duplicate posts with ajax load more wordpress

Firstly your cat parameter expects an array and you’re passing a json string to it… You need to json_decode back your array of posts to run through the query. Secondly, you are using query_posts() which if you look at the codex page reads: Note: This function will completely override the main query and isn’t intended … Read more

HTML Form Question

So all you want to do is have a person type information in a few fields, then you display all that information in a sentence structure? You don’t need PHP for that. JavaScript will do the job. The following page will set up a JavaScript form on your page and how to get the information … Read more