If you have and your settings are not saving then there is probably a permissions error with your htaccess file. You will need to make sure your file has at least 644 permissions.
Hope this helps, once you find a solution please tag the thread as resolved.
]]>Thanks for responding.
I do not want to change the permalink setting, this will change it for all posts.
Rather I have a need to determine the raw (plain permalink) from the current permalink: in other words reverse the rewrite for a specific link. In code and for specific conditions I want to set a page hyperlink to the “plain permalink” instead of the permalink specified in permalink settings.
Thanks,
Carlos
get_post(['name'=> $post_slug,]);
The returned post object has the post ID along with all other post properties. Parsing any possible request URL gets pretty complicated. You need to use the rewrite rules to find a matching regexp to use to parse the permalink.
If you are wanting the post ID in order to determine which template to use, for example in the “template_include” filter, you can get the ID of the currently queried object with get_queried_object_id()
. This may not be a post ID. Use in conjunction with is_single()
to be sure it is a post.