Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.GetPost() Method Throwing Exception #95

Open
GlennIM opened this issue Aug 29, 2018 · 2 comments
Open

client.GetPost() Method Throwing Exception #95

GlennIM opened this issue Aug 29, 2018 · 2 comments

Comments

@GlennIM
Copy link

GlennIM commented Aug 29, 2018

I have the plugin called "Featured Image from URL" installed and set to use the 1'st image in the post when and post is published and I am getting the following exception when calling the GetPost() function below. When I disable the "Featured Image from URL" no exception is thrown.

Post thepost = client.GetPost(Convert.ToInt32(postID));

Here is the exception...

{"response contains invalid dateTime value [response : struct mapped to type Post : member FeaturedImage mapped to type Object : struct mapped to XmlRpcStruct : member date_created_gmt : dateTime]"}

What can I do to make sure the call to GetPost() function works withour throwing the exception and have the "Featured Image from URL" plugin active?


Also,
I tried the following .CreateFromUrl() function shown below to create the Featured Image inside my function and want to know if the "url" needs to be an web url like "http://mydomain.com/wp-content/uploads/images/articles/vegan_recipes/img.jpg" or can it be from my local PC path like this...
"D:\Webs\MyWebsite.com\images\vegan_recipes\207236020333882044.jpg"

I tried calling CreateFromUrl() using a local file path but doesn't set the Featured Image. Is there a workaround?

var featureImage = Data.CreateFromUrl(url);

@Blackcat156
Copy link

Set Featured images
Post.FeaturedImageId =wordPressClient.UploadFile(Data.CreateFromUrl("ImgLink")).Id;

@Blackcat156
Copy link

Featured Images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants