Something along these lines
$letter = 'the string I'm looking for';
if (have_posts()) :
while (have_posts()) : the_post();
if ( stripos($post->post_content, $letter) ) {
//display your post stuff
} //end if stripos
endwhile;
} //end if have posts
Thanks Micheal for your help but I have a pagination (pagebar plugin) and I want it work when I click A letter for example. By code you give above paginations still gets all the posts but I need to make it get only posts starts with “A”. This should be less number of posts.
I saw some filters like posts_where but I couldn’t make it.
Not sure I’m helping you but look at the substr function.
Thanks a lot for your help. I solved the problem like this;
function arabunu ()
{
global $wpdb;
$sorgu= "AND $wpdb->posts.post_status='publish'
AND $wpdb->posts.post_type='post'
AND $wpdb->posts.post_title LIKE '".$_SESSION["harf"]."%'";
return $sorgu;
}
add_filter('posts_where', 'arabunu');
Okay, you are promoted to WordPress guru. Thanks for the answer 😉