You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am trying to save new post with thumbnail in wordpress database with following code
var img_url = SourceURL.Text + "/files/images/thumb/400_" + data.my_post.thumbnail;
var featureImage = Data.CreateFromUrl(img_url);
var img = data.client.UploadFile(featureImage);
post.FeaturedImageId = img.Id;
post.Id = data.client.NewPost(post);
and after that with checking database i see the new post and attachment and file upload successfully in wp-content/uploads but in attachment record parent_post set to 0 instead of new post id and thumbnail field is empty in wordpress how can i fix that i check blow links How to add thumbnail image into newPost#44 Featured Images & Custom Fields#64
The text was updated successfully, but these errors were encountered:
I have the same problem with you today. The solution is as follows:
UploadResult img = client.UploadFile(WordPressSharp.Models.Data.CreateFromUrl(item, "image/jpeg"));
If no file type is set,The default file type is: application/octet-stream
It can't be set as a cover picture.
So set the parameter: image/jpeg
You can solve the problem.
i am trying to save new post with thumbnail in wordpress database with following code
and after that with checking database i see the new post and attachment and file upload successfully in wp-content/uploads but in attachment record parent_post set to 0 instead of new post id and thumbnail field is empty in wordpress how can i fix that i check blow links
How to add thumbnail image into newPost #44
Featured Images & Custom Fields #64
The text was updated successfully, but these errors were encountered: