wordpress image a la une €8-30 EUR โพสต์ มากกว่า 9 ปีที่ผ่านมา
€8-30 EUR ชำระเงินเมื่อส่งงาน
Bonjour,
J'ai un bug sur une fonction d'attachement d'une image à la une sur wordpress téléchargée avec curl, le fichier ce télécharge bien dans la bibliothèque mais l'attachement ne fonctionne pas..
Voici le code :
$post_id = wp_insert_post( $my_post );
// Fetured Image inspired by GPL code of Tsai I-Ta [login to view URL]
$imageUrl = $value[5];
// Get image from url & check if is an available image
// Get the file name
$filename = substr($imageUrl, (strrpos($imageUrl, '/'))+1);
if (!(($uploads = wp_upload_dir(current_time('mysql')) ) && false === $uploads['error'])) {
echo "upload errors";
}
// Generate unique file name
$filename = wp_unique_filename( $uploads['path'], $filename );
// Move the file to the uploads dir
$new_file = $uploads['path'] . "/$filename";
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $imageUrl);
$file_data = curl_exec($c);
curl_close($c);
if (!$file_data) {
echo "missing image file data";
}
file_put_contents($new_file, $file_data);
// Set correct file permissions
$stat = stat( dirname( $new_file ));
$perms = $stat['mode'] & 0000666;
@ chmod( $new_file, $perms );
$wp_filetype = wp_check_filetype( $filename, $mimes );
extract( $wp_filetype );
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) {
return null;
}
$url = $uploads['url'] . "/$filename";
$attachment = array(
'post_mime_type' => $type,
'guid' => $url,
'post_parent' => null,
'post_title' => $filename,
'post_content' => '',
);
$thumb_id = wp_insert_attachment($attachment, $filename, $post_id);
if ( !is_wp_error($thumb_id) ) {
require_once(ABSPATH . '/wp-admin/includes/[login to view URL]');
// Added fix by misthero as suggested
wp_update_attachment_metadata( $thumb_id, wp_generate_attachment_metadata( $thumb_id, $new_file ) );
update_attached_file( $thumb_id, $new_file );
}
Seriez vous capable de trouver ce bug et sous quel tarif et delais? Merci
รหัสโปรเจกต์: 6230688
เกี่ยวกับโปรเจกต์ 6 ข้อเสนอ
โปรเจกต์ระยะไกล
ใช้งานอยู่ 10 ปีที่ผ่านมา
กำลังมองหาการสร้างรายได้ใช่ไหม? ที่อยู่อีเมล สมัครงานที่คล้ายกัน ประโยชน์ของการประมูลกับ Freelancer กำหนดงบประมาณและกรอบเวลาของคุณ
อธิบายข้อเสนอของคุณในภาพรวม
6 freelancers are bidding on average €29 EUR for this job
Ready to start "Right Now"
Give me chance to prove my ability and also quality work
i am waiting your positive replay from your side
i am highly interested to work with you
€38 EUR ใน 1 วัน
4.9 (682 รีวิว) hello i can do fix this issue with great perfection and timely manner as per your requirement. please discuss in message.
€14 EUR ใน 1 วัน
4.8 (139 รีวิว) Hi, I am ready to start it. But i have some questions for you. So kindly leave message for me, then i'll discuss it in depth.
€29 EUR ใน 1 วัน
4.9 (186 รีวิว) Dear Sir,
Award the project to get the work start.
I have total 4 years of experience in php/wordpress/html/css. I have gone through your little requirement. Please check my reviews and feedback for your reference.
Thanks & Regards
eGlobalSoft
€22 EUR ใน 1 วัน
4.8 (77 รีวิว) A proposal has not yet been provided
€10 EUR ใน 5 วัน
0.0 (0 รีวิว)