خانه / صفحه_دریافت_خبرنگار

صفحه_دریافت_خبرنگار

‘attachment’,
‘posts_per_page’ => ۱,
‘post_status’ => ‘any’,
‘post_parent’ =>$post_id
);

// reference new image to set as featured
$attachments = get_posts($args);

if($attachments){
foreach($attachments as $attachment){
set_post_thumbnail($post_id, $attachment->ID);
// only want one image
break;
}
}
}

//update_post_meta( $post_id->ID, ‘_thumbnail_id’, $image );

//$attachments = get_children( array(‘post_parent’ => $post->ID, ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order ID’) );

//$attachment = $attachments[0]; // ID of your single, attached image.

//set_post_thumbnail( $attachment );
echo ‘ok’;
?>

تمام حقوق این وب سایت متعلق به جمعیت خدمتگزاران ایثار و مقاومت می باشد