Can anyone point me to the standard code WordPress uses to turn a blog post url from this:
http://myblog.com/?p=123
into this:
http://myblog.com/this-is-my-articles-title-i-think
If the post title was: This Is My Article’s “Title” (I Think)
Can anyone point me to the standard code WordPress uses to turn a blog post url from this:
http://myblog.com/?p=123
into this:
http://myblog.com/this-is-my-articles-title-i-think
If the post title was: This Is My Article’s “Title” (I Think)
2
Answers
WordPress doesn’t redirect or rewrite requests.
index.php
serves the content based on the original request URI. It catches requests that don’t exist and figures them out from the plug. This code is in the WordPress document root in.htaccess
.If you want to know how WP generates the permalink slugs, look in
wp-includes/formatting.php
for this function:In your wordpress admin go to settings > permalinks and select ‘post name’ then save changes and you’re all set.