is it possible to create a loop of posts using WP_Query or query_posts using the title?
ie
$args = array('post_title'='LIKE '.$str.'% ');
$res = WP_Query($arg);
// the loop...
// trying this now...
$mypostids = $wpdb->get_col("select ID from $wpdb->posts where post_title like 'Abb%' ");
echo count($mypostids).", "; // works but can't echo out array of IDs for the next args?
$args = array(
'post__in'=> $mypostids
);
$res = WP_Query($args);
while( $res->have_posts() ) : $res->the_post(); ...
functions.php
Then:
got this working with the help from this post in the end. Cheers guys;
Get the title from another loop
and use the $title variable if you wish.
Yes it is possible….
These replies seem to me as trying to hack wordpress.
Refer to the same question on stack overflow:
https://stackoverflow.com/questions/25761593/wp-query-with-post-title-like-something-and-category
This works if you want to do a search query by title ordered by title:
This example query is for a post type named watches and the ‘s’ (search term) is where you can look for your post titles on the query