1

This is my permalink structure

/%post_id%-%postname%/

https://example.com/in/140521-test-post/

https://example.com/us/140524-second-post/

How can I check "test-post" exist or not? I'm using wpml for multi language so not able to check using slug.

Post ID is causing issues while checking. Is there any solution for this?

When using url_to_postid(), this format is working https://example.com/in/test-post/, but not this

https://example.com/in/140521-test-post/

For example:

url_to_postid('https://example.com/in/test-post/');

any solution to handle with post id?

url_to_postid('https://example.com/in/[%post_id%-]test-post/');
url_to_postid('https://example.com/in/[\d\-]+test-post/');

Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.