Query posts by title?
I.d like to be able to query posts from a custom post type by their title, to list posts that share the same string in the title as the page I’m on. Something like this:
<?php $thetitle = the_title(); ?>
<?php query_posts("post_type=myposttype&post_title=$thetitle"); ?>
<?php while (have_posts()): the_post(); ?>
…but obviously the ‘post_title’ parameter doesn’t exist. Is there another way to do this? I’m a bit of a novice when it comes to PHP.
- The topic ‘Query posts by title?’ is closed to new replies.