WordPressSharp icon indicating copy to clipboard operation
WordPressSharp copied to clipboard

How Can I Get the Post Name for Link ?

Open GlennIM opened this issue 6 years ago • 2 comments

I need it to return the Post Name permalink format not the Plain format. How can I convert this to the Post name format ?

I checked the blog I created a post on and the Pernalink settings are set to "Post Name".

string postID = client.NewPost(post); Post thepost = client.GetPost(Convert.ToInt32(postID)); // returns "http://mysite.com/?p=6175"

GlennIM avatar Jul 08 '18 16:07 GlennIM

Did you create your post in draft mode?

kombasltd avatar Aug 09 '18 08:08 kombasltd

Yes... creating in "Draft Mode"

If I create it in Publish mode, will it return the post name format?

Also, before I publish a post, can you tell me how to check to see if it already exists already? I don't want to post duplicate content. Can you show me a code snippet I would use to check for an existing post?

Thanks Again, Glenn

GlennIM avatar Aug 09 '18 13:08 GlennIM