• hi
    i create the box in admin panel to add new file along with post/page,
    when i upload the file publish the post/page,so i want to add the attachment to newly added post ,i use the

    $attach_id = wp_insert_attachment( $my_post,ARTICAL_FULLPATH.$filename,$post_id );
    $attach_data = wp_generate_attachment_metadata( $attach_id,ARTICAL_FULLPATH.$filename );

    the table show the four entry of the attachment.i wan to add only one

    thanks

    have dream day

  • The topic ‘add image to post’ is closed to new replies.