Support » Fixing WordPress » How to get post title from post slug?

  • Using WP 1.5.x and the Dynamic Text Replace plugin, I’m trying to figure out an easy way to let me quickly link to certain posts using their slug rather than their post ID. I’ve got it mostly working, but I need to figure out how to get the visible text of the link to be the post’s title rather than the slug. Basically, what I need is the WP equivalent of “SELECT post_title FROM posts WHERE post_slug = $foo”; it’s been so long since I’ve mucked around w/ WP, though, that I’m completely blanking on if there’s a function to handle it or how I’d do a direct database call if that’s what I need to do. Can anyone help me out here?



  • The topic ‘How to get post title from post slug?’ is closed to new replies.