Sql query – how get the permalink from the guid?
-
Hi, i have this sql query:
mysql_query("SELECT distinct ID, post_title, guid, wp_posts.ID FROM wp_posts WHERE wp_posts.post_status = 'publish' AND wp_posts.post_type = 'post' order by wp_posts.ID desc");
then when i try to link the post, the link is in the format https://localhost/?p=1. I’d like the link as the permalink in the blog settings (https://localhost/2011/11/06/hello-world/.
I read in the forum to use get_permalink () but i don’t know how to use it, i get an error!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Sql query – how get the permalink from the guid?’ is closed to new replies.